Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Marko Djukic (marko@oblo.com)
コード例 #1
0
ファイル: Application.php プロジェクト: jubinpatel/horde
 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']);
 }
コード例 #2
0
ファイル: sql.php プロジェクト: jubinpatel/horde
 function Hylax_Storage_sql($params)
 {
     parent::Hylax_Storage($params);
     $this->initialise();
     /* Set up the storage attributes object in the $_attributes var. */
     $attrib_params = array('primary_table' => 'hylax_faxes', 'attribute_table' => 'hylax_fax_attributes', 'id_column' => 'fax_id');
     $this->_attributes = new Hylax_SQL_Attributes($this->_db, $attrib_params);
 }
コード例 #3
0
ファイル: Storage.php プロジェクト: jubinpatel/horde
 /**
  * Attempts to return a reference to a concrete Hylax_Storage instance
  * based on $driver.
  *
  * It will only create a new instance if no Hylax_Storage 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_Storage::singleton()
  *
  * @param string $driver  The type of concrete Hylax_Storage 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_Storage instance, or false on
  *                error.
  */
 function &singleton($driver, $params = array())
 {
     static $instances;
     if (!isset($instances)) {
         $instances = array();
     }
     $signature = serialize(array($driver, $params));
     if (!isset($instances[$signature])) {
         $instances[$signature] =& Hylax_Storage::factory($driver, $params);
     }
     return $instances[$signature];
 }