summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/odbc
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-25 14:21:41 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-25 14:21:41 +0100
commit2e171023bae38735ec08bbd9cb160cee75edbc62 (patch)
tree15327555ec2101f723f6ae35c6c388abf1b18317 /system/database/drivers/odbc
parente7d017bcc38909f55e8f817b27263e59d1ca5598 (diff)
Make db_pconnect an alias for db_connect(TRUE) and reduce code repetition
Diffstat (limited to 'system/database/drivers/odbc')
-rw-r--r--system/database/drivers/odbc/odbc_driver.php19
1 files changed, 5 insertions, 14 deletions
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);
}
// --------------------------------------------------------------------