当前位置: 首页>>代码示例>>PHP>>正文


PHP Source::__construct方法代码示例

本文整理汇总了PHP中Source::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Source::__construct方法的具体用法?PHP Source::__construct怎么用?PHP Source::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Source的用法示例。


在下文中一共展示了Source::__construct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($media, $srcset, $type = null)
 {
     if (is_int($media)) {
         $media = "(min-width: {$media}px)";
     }
     parent::__construct($media, $srcset, $type);
 }
开发者ID:tomkyle,项目名称:responsivepicture,代码行数:7,代码来源:MinWidthSource.php

示例2: __construct

 public function __construct($type, $args)
 {
     parent::__construct($type, $args);
     if (!isset($args['db-name'])) {
         throw new Exception('DB Source requires a db-name to be set');
     }
 }
开发者ID:sickhye,项目名称:mysql-dbcompare,代码行数:7,代码来源:Source.php

示例3: __construct

 /**
  * Create Sass source associated with given string
  *
  * @param $context Context Context
  * @param $source string Sass source code
  * @param $modifiedTime int Last modified time (unix timestamp)
  * @param $humanName string|null Human-readable description (used for debugging)
  */
 public function __construct(Context $context, $source, $modifiedTime, $humanName = null)
 {
     parent::__construct($context);
     $this->rawSource = $source;
     $this->rawModifiedTime = $modifiedTime;
     $this->humanName = $humanName;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:StringSource.class.php

示例4: __construct

 /**
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->_db_host = MEASUREMENTS_HOST;
     $this->_db_user = MEASUREMENTS_USER;
     $this->_db_pass = MEASUREMENTS_PASS;
     $this->_db_name = "forecasts";
     $this->_db = new MySQLi($this->_db_host, $this->_db_user, $this->_db_pass, $this->_db_name);
     if ($this->_db->connect_errno) {
         throw new Exception("No connection to the forecasts database");
         exit;
     }
     $this->_default_columns = ['Temperature' => ['calc' => 'AVG', 'name' => 'temp'], 'Rainfall' => ['calc' => 'sum', 'name' => 'precip'], 'Humidity' => ['calc' => 'avg', 'name' => 'humid'], 'WindSpeed' => ['calc' => 'avg', 'name' => 'windSpeed'], 'WindDir' => ['calc' => 'avg', 'name' => 'windDir'], 'GustSpeed' => ['calc' => 'avg', 'name' => 'gustSpeed'], 'GustDir' => ['calc' => 'avg', 'name' => 'gustDir']];
 }
开发者ID:kukua,项目名称:kukua-dashboard,代码行数:18,代码来源:Foreca.php

示例5: __construct

 /**
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     //connect mysql and set buffer to _db
     $this->_db_host = MEASUREMENTS_HOST;
     $this->_db_user = MEASUREMENTS_USER;
     $this->_db_pass = MEASUREMENTS_PASS;
     $this->_db_name = "measurements";
     $this->_db = new MySQLi($this->_db_host, $this->_db_user, $this->_db_pass, $this->_db_name);
     if ($this->_db->connect_errno) {
         throw new Exception("No connection to measurements database");
         exit;
     }
     $this->_default_columns = ['Temperature' => ['calc' => 'AVG', 'name' => 'temp', 'where' => 'temp < 300'], 'Rainfall' => ['calc' => 'SUM', 'name' => 'rain', 'where' => 'rain < 300'], 'Pressure' => ['calc' => 'AVG', 'name' => 'pressure'], 'Humidity' => ['calc' => 'AVG', 'name' => 'humid', 'where' => 'humid <= 100'], 'WindSpeed' => ['calc' => 'AVG', 'name' => 'windSpeed', 'where' => 'windSpeed < 3000'], 'WindDir' => ['calc' => 'AVG', 'name' => 'windDir', 'where' => 'windDir < 360 AND windDir >= 0'], 'GustSpeed' => ['calc' => 'AVG', 'name' => 'gustSpeed', 'where' => 'gustSpeed < 3000'], 'GustDir' => ['calc' => 'AVG', 'name' => 'gustDir', 'where' => 'gustDir < 360 AND gustDir >= 0'], 'SolarRad' => ['calc' => 'AVG', 'name' => 'solarIrrad'], 'Battery' => ['calc' => 'AVG', 'name' => 'battery']];
 }
开发者ID:kukua,项目名称:kukua-dashboard,代码行数:19,代码来源:Measurements.php

示例6: __construct

 public function __construct(Pakiti &$pakiti)
 {
     parent::__construct($pakiti);
     $this->setName(RepositoriesSource::$NAME);
 }
开发者ID:basvandervlies,项目名称:pakiti3,代码行数:5,代码来源:RepositoriesSource.php

示例7: __construct

 public function __construct(Pakiti &$pakiti)
 {
     parent::__construct($pakiti);
     $this->_pakiti =& $pakiti;
     $this->setName(CveSource::$NAME);
 }
开发者ID:basvandervlies,项目名称:pakiti3,代码行数:6,代码来源:CveSource.php


注:本文中的Source::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。