singleton() public method

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()
public singleton ( string $driver, array $params = [] ) : mixed
$driver string The type of concrete Hylax_Storage subclass to return.
$params array 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.
Exemplo n.º 1
0
 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']);
 }