/** * Parse configuration array into options for PDO constructor. * * http://pecl.php.net/bugs/7234 * Setting a bogus socket does not appear to work. * * @throws Horde_Db_Exception * @return array [dsn, username, password] */ protected function _parseConfig() { $this->_config['adapter'] = 'mysql'; if (isset($this->_config['port'])) { if (empty($this->_config['host'])) { $msg = 'host is required if port is specified'; throw new Horde_Db_Exception($msg); } if (preg_match('/[^\\d\\.]/', $this->_config['host'])) { $msg = 'pdo_mysql ignores port unless IP address is used for host'; throw new Horde_Db_Exception($msg); } } return parent::_parseConfig(); }
/** * Parse configuration array into options for PDO constructor. * * @throws Horde_Db_Exception * @return array [dsn, username, password] */ protected function _parseConfig() { $this->_config['adapter'] = 'pgsql'; return parent::_parseConfig(); }