From 2e171023bae38735ec08bbd9cb160cee75edbc62 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 25 Feb 2014 15:21:41 +0200 Subject: Make db_pconnect an alias for db_connect(TRUE) and reduce code repetition --- system/database/drivers/odbc/odbc_driver.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'system/database/drivers/odbc/odbc_driver.php') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 662a1063a..14c85c8e2 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -104,23 +104,14 @@ class CI_DB_odbc_driver extends CI_DB { /** * Non-persistent database connection * + * @param bool $persistent * @return resource */ - public function db_connect() + public function db_connect($persistent = FALSE) { - return @odbc_connect($this->dsn, $this->username, $this->password); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @return resource - */ - public function db_pconnect() - { - return @odbc_pconnect($this->dsn, $this->username, $this->password); + return ($persistent === TRUE) + ? odbc_pconnect($this->dsn, $this->username, $this->password) + : odbc_connect($this->dsn, $this->username, $this->password); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b