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();
}