diff options
| author | 2015-07-30 16:04:11 +0200 | |
|---|---|---|
| committer | 2015-07-30 16:04:11 +0200 | |
| commit | 5fbbfdea8afdb399175abf18f1dcf1b6cabc2714 (patch) | |
| tree | 6506dafeb093f78169feee0df648c48d3e97ebc6 /lib/Minz/ModelPdo.php | |
| parent | 214a5cc9a4c2b821961bc21f22b4b08e34b5be68 (diff) | |
| parent | 3d4a75aa3d37a239a34e1fa35def261a2c988665 (diff) | |
Merge branch 'dev' into beta
Diffstat (limited to 'lib/Minz/ModelPdo.php')
| -rw-r--r-- | lib/Minz/ModelPdo.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 3e8ec1f43..25999f02b 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -53,21 +53,19 @@ class Minz_ModelPdo { $this->current_user = $currentUser; self::$sharedCurrentUser = $currentUser; + $driver_options = isset($conf->db['pdo_options']) && is_array($conf->db['pdo_options']) ? $conf->db['pdo_options'] : array(); + try { $type = $db['type']; if ($type === 'mysql') { $string = 'mysql:host=' . $db['host'] . ';dbname=' . $db['base'] . ';charset=utf8'; - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ); + $driver_options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8'; $this->prefix = $db['prefix'] . $currentUser . '_'; } elseif ($type === 'sqlite') { $string = 'sqlite:' . join_path(DATA_PATH, 'users', $currentUser, 'db.sqlite'); - $driver_options = array( - //PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - ); + //$driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; $this->prefix = ''; } else { throw new Minz_PDOConnectionException( |
