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/ibase/ibase_driver.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php index 4cff5f448..c85b19955 100644 --- a/system/database/drivers/ibase/ibase_driver.php +++ b/system/database/drivers/ibase/ibase_driver.php @@ -69,23 +69,14 @@ class CI_DB_ibase_driver extends CI_DB { /** * Non-persistent database connection * + * @param bool $persistent * @return resource */ - public function db_connect() + public function db_connect($persistent = FALSE) { - return @ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @return resource - */ - public function db_pconnect() - { - return @ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); + return ($persistent === TRUE) + ? @ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set) + : @ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b