Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit b4346ef

Browse files
Add options parameter for extra PDO options
1 parent 16c0c8b commit b4346ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/phpSec/Store/Pdo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Pdo extends Store {
2525
*/
2626
private $psl = null;
2727

28-
public function __construct($loc, \phpSec\Core $psl) {
28+
public function __construct($loc, \phpSec\Core $psl, $options = Array()) {
2929
$this->psl = $psl;
3030

3131
/* Separate username and password from DSN */
@@ -34,7 +34,7 @@ public function __construct($loc, \phpSec\Core $psl) {
3434

3535
/* We try to connect to the database. If this fails throw an error. */
3636
try {
37-
$this->dbh = new \PDO($loc, $parts['username'], $parts['password']);
37+
$this->dbh = new \PDO($loc, $parts['username'], $parts['password'], $options);
3838
} catch(\PDOException $e) {
3939
throw new \phpSec\Exception\IOException('Database connection failed: ' . $e->getMessage());
4040
return false;
@@ -270,4 +270,4 @@ private function parseDsn($dsn) {
270270

271271
return $parsed;
272272
}
273-
}
273+
}

0 commit comments

Comments
 (0)