summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-06-03 22:07:25 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-06-03 22:07:25 +0200
commit568ab2313d5a922e06d7f0c33b3e39dd152d43db (patch)
treea7bb0fabf61b4634f931355078929248c285fadc /lib
parent1d7e5a13ef3aaf9e37e36175f9bfeb9b25c77e35 (diff)
PDO options for e.g. SSL
https://github.com/FreshRSS/FreshRSS/issues/868
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/ModelPdo.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php
index 3e8ec1f43..e82c1f30a 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 = 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(