public function __construct($media, $srcset, $type = null) { if (is_int($media)) { $media = "(min-width: {$media}px)"; } parent::__construct($media, $srcset, $type); }
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'); } }
/** * 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; }
/** * @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']]; }
/** * @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']]; }
public function __construct(Pakiti &$pakiti) { parent::__construct($pakiti); $this->setName(RepositoriesSource::$NAME); }
public function __construct(Pakiti &$pakiti) { parent::__construct($pakiti); $this->_pakiti =& $pakiti; $this->setName(CveSource::$NAME); }