diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-24 20:41:42 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-24 20:41:42 +0200 |
commit | 3b0130d97409bc0d983aa812b50e579cc53b8e48 (patch) | |
tree | ba93ad2522bd0a8fe54048d3b0023caa0558d3be /system/database/drivers/pdo/pdo_driver.php | |
parent | 7e53bc6326091fb4f1ed91c93e66a89f18be342f (diff) |
Add pdo_oci subdriver
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r-- | system/database/drivers/pdo/pdo_driver.php | 49 |
1 files changed, 16 insertions, 33 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index dc03864a6..9fbdfdd55 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -167,7 +167,7 @@ class CI_DB_pdo_driver extends CI_DB { } // Add charset to the DSN, if needed - if ( ! empty($this->char_set) && in_array($this->subdriver, array('4D', 'sybase', 'mssql', 'dblib', 'oci'))) + if ( ! empty($this->char_set) && in_array($this->subdriver, array('4D', 'sybase', 'mssql', 'dblib'))) { $this->dsn .= 'charset='.$this->char_set.';'; } @@ -178,37 +178,13 @@ class CI_DB_pdo_driver extends CI_DB { /** * Non-persistent database connection * - * @return object - */ - public function db_connect() - { - return $this->_pdo_connect(); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @return object - */ - public function db_pconnect() - { - return $this->_pdo_connect(TRUE); - } - - // -------------------------------------------------------------------- - - /** - * PDO connection - * * @param bool * @return object */ - protected function _pdo_connect($persistent = FALSE) + public function db_connect($persistent = FALSE) { $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; - $persistent === FALSE OR $this->options[PDO::ATTR_PERSISTENT] = TRUE; + $this->options[PDO::ATTR_PERSISTENT] = $persistent; // Connecting... try @@ -229,6 +205,18 @@ class CI_DB_pdo_driver extends CI_DB { // -------------------------------------------------------------------- /** + * Persistent database connection + * + * @return object + */ + public function db_pconnect() + { + return $this->db_connect(TRUE); + } + + // -------------------------------------------------------------------- + + /** * Database version number * * @return string @@ -435,12 +423,7 @@ class CI_DB_pdo_driver extends CI_DB { */ protected function _field_data($table) { - if ($this->subdriver === 'oci') - { - // Analog function for oci - return 'SELECT * FROM '.$this->escape_identifiers($table).' WHERE ROWNUM <= 1'; - } - elseif ($this->subdriver === 'sqlite') + if ($this->subdriver === 'sqlite') { // Analog function for sqlite return 'PRAGMA table_info('.$this->escape_identifiers($table).')'; |