diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-05 21:04:31 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-05 21:04:31 +0200 |
commit | d74e027614fd1d5209180800e97bb8a01e5d4acf (patch) | |
tree | a079e66009f0700bc39d38c6727eb8c049f2e595 /system/database/drivers/pdo/pdo_driver.php | |
parent | 92d18a7b6c46eadc9db58ca60ffce3980e2313ff (diff) | |
parent | 9e3a83a65668cc26b685f0b35a4428809435f7c9 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/db_subdrivers
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r-- | system/database/drivers/pdo/pdo_driver.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index dcae1a591..26ad3831a 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -154,9 +154,20 @@ class CI_DB_pdo_driver extends CI_DB { */ public function version() { - return isset($this->data_cache['version']) - ? $this->data_cache['version'] - : $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION); + if (isset($this->data_cache['version'])) + { + return $this->data_cache['version']; + } + + // Not all subdrivers support the getAttribute() method + try + { + return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION); + } + catch (PDOException $e) + { + return parent::version(); + } } // -------------------------------------------------------------------- |