public function __construct($params) { parent::__construct($params); $this->_states = Hylax::getStates(); $this->_stat_cols = Hylax::getStatCols(); $this->_cmd = array('sendfax' => '/usr/bin/sendfax'); }
protected function _init() { global $conf; /* Hylax Driver */ $this->gateway = Hylax_Driver::singleton($conf['fax']['driver'], $conf['fax']['params']); /* Hylax storage driver. */ $this->storage = Hylax_Storage::singleton('sql', $conf['sql']); }
/** * Attempts to return a reference to a concrete Hylax_Driver instance * based on $driver. It will only create a new instance if no * Hylax_Driver instance with the same parameters currently exists. * * This should be used if multiple storage sources are required. * * This method must be invoked as: $var = &Hylax_Driver::singleton() * * @param string $driver The type of concrete Hylax_Driver subclass to * return. * @param array $params A hash containing any additional configuration or * connection parameters a subclass might need. * * @return mixed The created concrete Hylax_Driver instance, or false on * error. */ public function &singleton($driver = null, $params = null) { static $instances; if (is_null($driver)) { $driver = $GLOBALS['conf']['fax']['driver']; } if (!isset($instances)) { $instances = array(); } $signature = serialize(array($driver, $params)); if (!isset($instances[$signature])) { $instances[$signature] =& Hylax_Driver::factory($driver, $params); } return $instances[$signature]; }
public function __construct($params) { parent::__construct($params); $this->_states = Hylax::getStates(); $this->_stat_cols = Hylax::getStatCols(); }