ZF2-570: Pgsql adapater has codes related to MySQL
Description
While trying to connect using:
public function getServiceConfig()
{
return array(
'factories' => array(
'db_adapter' => function($sm) {
$config = $sm->get('Configuration');
$dbAdapter = new \Zend\Db\Adapter\Adapter($config['db']);
return $dbAdapter;
},
),
);
}
return array(
'db' => array(
'driver' => 'Pgsql',
'database' => 'db_name',
'username' => 'user',
'password' => 'pass',
'hostname' => '127.0.0.1',
),
);
I got the following error: {quote} Fatal error: Uncaught exception 'Zend\Db\Adapter\Exception\RuntimeException' with message 'The Mysqli extension is required for this adapter but the extension is not loaded' in /srv/httpd/brainpop/dev/web/vendor/ZendFramework/library/Zend/ServiceManager/ServiceManager.php on line 697
Zend\Db\Adapter\Exception\RuntimeException: The Mysqli extension is required for this adapter but the extension is not loaded in /srv/httpd/brainpop/dev/web/vendor/ZendFramework/library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php on line 114 {quote}
After further check in the code I found out that MySQL code is embedded within the Pgsql adapter in the following files: * library/Zend/Db/Adapter/Driver/Pgsql/Connection.php * library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
Tried to hack it a bit but failed as other errors popped updb
Comments
Posted by Frank Brückner (frosch) on 2012-09-19T06:23:18.000+0000
Posted by Ralph Schindler (ralph) on 2012-10-08T20:12:22.000+0000
This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2595