summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-07-05 21:04:16 +0100
committerJamie Matthews <[email protected]>2010-07-05 21:04:16 +0100
commit6547b15aee997fb0db43c7fc0b1f33110993e215 (patch)
tree576deb56d5ac468accb1560d1506593e0d89db15 /idiorm.php
parent5233962fcc0f84cedb9baa2d633ed0231dbd4ff3 (diff)
Add 'driver_options' setting to allow driver-specific connection options to be passed through to the PDO constructor. Closes #2
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/idiorm.php b/idiorm.php
index 7729636..be56e99 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -84,6 +84,7 @@
'error_mode' => PDO::ERRMODE_EXCEPTION,
'username' => null,
'password' => null,
+ 'driver_options' => null,
);
// Database connection, instance of the PDO class
@@ -182,7 +183,8 @@
$connection_string = self::$config['connection_string'];
$username = self::$config['username'];
$password = self::$config['password'];
- self::$db = new PDO($connection_string, $username, $password);
+ $driver_options = self::$config['driver_options'];
+ self::$db = new PDO($connection_string, $username, $password, $driver_options);
self::$db->setAttribute(PDO::ATTR_ERRMODE, self::$config['error_mode']);
}
}