summaryrefslogtreecommitdiff
path: root/includes/database/database.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-29 09:30:36 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-29 09:30:36 +0000
commit205c5b2415deb10d4afba32249e7f5f989a097b1 (patch)
treecb11740ba304151ee86922768e62d4a269e74d19 /includes/database/database.inc
parent9b391c2e6ec9eee45a4ac701e3ee5104372b04d8 (diff)
downloadbrdo-205c5b2415deb10d4afba32249e7f5f989a097b1.tar.gz
brdo-205c5b2415deb10d4afba32249e7f5f989a097b1.tar.bz2
- Patch #337926 by hswong3i, Dave Reid, Damien Tournoud: forced connection with PDF:CASE_LOWER.
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r--includes/database/database.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index fc94e55e7..f05a71242 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -211,6 +211,13 @@ abstract class DatabaseConnection extends PDO {
protected $transactionClass = NULL;
/**
+ * The name of the Statement class for this connection.
+ *
+ * @var string
+ */
+ protected $statementClass = NULL;
+
+ /**
* The schema object for this connection.
*
* @var object
@@ -219,8 +226,9 @@ abstract class DatabaseConnection extends PDO {
function __construct($dsn, $username, $password, $driver_options = array()) {
// Fallback to DatabaseStatementBase if the driver has not specified one.
- $statement_class = isset($driver_options['statement_class']) ? $driver_options['statement_class'] : 'DatabaseStatementBase';
- unset($driver_options['statement_class']);
+ if (empty($this->statementClass)) {
+ $this->statementClass = 'DatabaseStatementBase';
+ }
// Because the other methods don't seem to work right.
$driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
@@ -229,8 +237,8 @@ abstract class DatabaseConnection extends PDO {
parent::__construct($dsn, $username, $password, $driver_options);
// Set a specific PDOStatement class if the driver requires that.
- if (!empty($statement_class)) {
- $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($statement_class, array($this)));
+ if ($this->statementClass != 'PDOStatement') {
+ $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array($this->statementClass, array($this)));
}
}