diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-02 13:58:54 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-02 13:58:54 +0200 |
commit | d66872ae5d7cd4d2b531251a9c63528e81af3322 (patch) | |
tree | 4ed76ac11914b22e2aa9d43f65db6f27b1b7bd7a /system/database/drivers/mssql/mssql_driver.php | |
parent | f00b9f02425afc902d79209c108ae74ab73342c9 (diff) | |
parent | fac3761c6a01a12457c61cd4e3b17dba5ee26bf7 (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into feature/db_subdrivers
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r-- | system/database/drivers/mssql/mssql_driver.php | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 7634be2bb..3026b36dc 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -83,40 +83,16 @@ class CI_DB_mssql_driver extends CI_DB { /** * Non-persistent database connection * - * @return resource - */ - public function db_connect() - { - return $this->_mssql_connect(); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @return resource - */ - public function db_pconnect() - { - return $this->_mssql_connect(TRUE); - } - - // -------------------------------------------------------------------- - - /* - * MSSQL Connect - * * @param bool * @return resource */ - protected function _mssql_connect($persistent = FALSE) + public function db_connect($persistent = FALSE) { - $conn_id = ($persistent) + $this->conn_id = ($persistent) ? @mssql_pconnect($this->hostname, $this->username, $this->password) : @mssql_connect($this->hostname, $this->username, $this->password); - if ( ! $conn_id) + if ( ! $this->conn_id) { return FALSE; } @@ -127,7 +103,19 @@ class CI_DB_mssql_driver extends CI_DB { $this->_quoted_identifier = empty($query) ? FALSE : (bool) $query['qi']; $this->_escape_char = ($this->_quoted_identifier) ? '"' : array('[', ']'); - return $conn_id; + return $this->conn_id; + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @return resource + */ + public function db_pconnect() + { + return $this->db_connect(TRUE); } // -------------------------------------------------------------------- |