Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 193ae72

Browse files
author
Jamie Snape
committed
ENH: Allow MySQL driver options to be specified in database.ini
For example to connect over SSL: database.params.driver_options.1010 = "/path/to/client-key.pem" database.params.driver_options.1011 = "/path/to/client-cert.pem" database.params.driver_options.1012 = "/path/to/ca-cert.pem"
1 parent e05afd9 commit 193ae72

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/Bootstrap.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,15 @@ protected function _initConfig()
8484
throw new Zend_Exception('It appears PDO is not setup to support MySQL. '.
8585
'Please check your PDO configuration.');
8686
}
87-
$pdoParams = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true);
87+
if(isset($configDatabase->database->params->driver_options))
88+
{
89+
$pdoParams = $configDatabase->database->params->driver_options->toArray();
90+
}
91+
else
92+
{
93+
$pdoParams = array();
94+
}
95+
$pdoParams[PDO::MYSQL_ATTR_USE_BUFFERED_QUERY] = true;
8896
$params = array(
8997
'host' => $configDatabase->database->params->host,
9098
'username' => $configDatabase->database->params->username,

0 commit comments

Comments
 (0)