本文整理汇总了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);
}
示例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');
}
}
示例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;
}
示例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']];
}
示例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']];
}
示例6: __construct
public function __construct(Pakiti &$pakiti)
{
parent::__construct($pakiti);
$this->setName(RepositoriesSource::$NAME);
}
示例7: __construct
public function __construct(Pakiti &$pakiti)
{
parent::__construct($pakiti);
$this->_pakiti =& $pakiti;
$this->setName(CveSource::$NAME);
}