DbPatch_Core_Db::__construct PHP Метод

__construct() публичный Метод

public __construct ( Zend_Config | Zend_Config_Ini | Zend_Config_Xml $config ) : void
$config Zend_Config | Zend_Config_Ini | Zend_Config_Xml
Результат void
    public function __construct($config)
    {
        $this->config = $config;
        if (!isset($config->db)) {
            throw new DbPatch_Exception('No database configuration found');
        }
        if ($config->db instanceof Zend_Db_Adapter_Abstract) {
            $this->adapter = $config->db;
        } else {
            $this->adapter = Zend_Db::factory($config->db->adapter, $config->db->params->toArray());
        }
        // Enable compatibility for the bin_dir setting
        $this->enableOldConfigCompatibility();
    }