lib/db: Allow to configure persistent connections

refs 
This commit is contained in:
Eric Lippmann 2015-09-07 16:15:04 +02:00
parent 44c19fc5e6
commit 4763b6b20a
1 changed files with 2 additions and 2 deletions
library/Icinga/Data/Db

View File

@ -62,8 +62,7 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
private static $driverOptions = array( private static $driverOptions = array(
PDO::ATTR_TIMEOUT => 10, PDO::ATTR_TIMEOUT => 10,
PDO::ATTR_CASE => PDO::CASE_LOWER, PDO::ATTR_CASE => PDO::CASE_LOWER,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
// TODO: allow configurable PDO::ATTR_PERSISTENT => true
); );
/** /**
@ -131,6 +130,7 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
'username' => $this->config->username, 'username' => $this->config->username,
'password' => $this->config->password, 'password' => $this->config->password,
'dbname' => $this->config->dbname, 'dbname' => $this->config->dbname,
'persistent' => (bool) $this->config->get('persistent', false),
'options' => & $genericAdapterOptions, 'options' => & $genericAdapterOptions,
'driver_options' => & $driverOptions 'driver_options' => & $driverOptions
); );