factory() public static method

Attempts to return a concrete Vilma_Driver instance based on $driver.
public static factory ( string $driver = null, array $params = null ) : Vilma_Driver
$driver string The type of concrete Vilma_Driver subclass to return.
$params array A hash containing any additional configuration or connection parameters a subclass might need.
return Vilma_Driver The newly created concrete Vilma_Driver instance.
Esempio n. 1
0
 protected function _init()
 {
     $this->driver = Vilma_Driver::factory();
     // Get the currently active domain, possibly storing a change into the
     // session.
     // Domain is passed in by ID, which may or may not be the
     // the same as the actual DNS domain name.
     $domain_id = Horde_Util::getFormData('domain_id');
     if (strlen($domain_id)) {
         $domain = $this->driver->getDomain($domain_id);
         if (!empty($domain['domain_name'])) {
             $this->curdomain = $domain;
             Vilma::setCurDomain($domain);
         }
     } elseif ($domain = $GLOBALS['session']->get('vilma', 'domain')) {
         $this->curdomain = $domain;
     }
 }