From 98e4bc0802a4a0a19378cefa1ceba606c7654b93 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 28 Jul 2007 17:42:38 +0000 Subject: [PATCH] Removing the pconnect option from BSDb and it's children. * Db.php: (BSDb::connect): Removing the $pconnect paramater (BSDb::_pConnect): Removed. * DbMySql.php: (BSDbMySql::_pConnect): Removed * DbMySqlI.php: (BSDbMySqlI::_pConnect): Removed * DbPostgreSql.php: (BSDbPostgreSql::_pConnect): Removed --- Db.php | 18 ++---------------- DbMySql.php | 17 +---------------- DbMySqlI.php | 9 --------- DbPostgreSql.php | 9 --------- 4 files changed, 3 insertions(+), 50 deletions(-) diff --git a/Db.php b/Db.php index 7fbb29e..e39addd 100644 --- a/Db.php +++ b/Db.php @@ -106,15 +106,14 @@ abstract class BSDb * @param string User name * @param string Password * @param string Database name - * @param bool Use p-connect? * * @return bool Result of connect */ - public function connect($server, $user, $password, $database, $pconnect) + public function connect($server, $user, $password, $database) { if ($this->dblink == false) { - $this->dblink = $this->{($pconnect ? '_connect' : '_pConnect')}($server, $user, $password, $database); + $this->dblink = $this->_connect($server, $user, $password, $database); if ($this->dblink == false) { @@ -139,19 +138,6 @@ abstract class BSDb */ protected abstract function _connect($server, $user, $password, $database); - /** - * Abstract function that returns a database link after establishing a connection. This just - * calls the function and does not do any checking - * - * @param string Server name - * @param string User name - * @param string Password - * @param string Database name - * - * @return resource Database link - */ - protected abstract function _pConnect($server, $user, $password, $database); - // ################################################################### /** * Send a query to the open database link diff --git a/DbMySql.php b/DbMySql.php index c4a6371..c009152 100644 --- a/DbMySql.php +++ b/DbMySql.php @@ -55,22 +55,7 @@ class BSDbMySql extends BSDb return $link; } - - // ################################################################### - /** - * Wrapper: mysql_pconnect - */ - protected function _pConnect($server, $user, $password, $database) - { - $link = @mysql_pconnect($server, $user, $password); - if ($link) - { - $this->_selectDb($database, $link); - } - - return $link; - } - + // ################################################################### /** * Opens a connection to the specified database name diff --git a/DbMySqlI.php b/DbMySqlI.php index 161f008..9e0dec0 100644 --- a/DbMySqlI.php +++ b/DbMySqlI.php @@ -50,15 +50,6 @@ class BSDbMySqlI extends BSDb return mysqli_connect($server, $user, $password, $database); } - // ################################################################### - /** - * Wrapper: mysql_pconnect - */ - protected function _pConnect($server, $user, $password, $database) - { - return mysqli_connect($server, $user, $password, $database); - } - // ################################################################### /** * Wrapper: mysql_query diff --git a/DbPostgreSql.php b/DbPostgreSql.php index a079cb0..c49fd3b 100644 --- a/DbPostgreSql.php +++ b/DbPostgreSql.php @@ -67,15 +67,6 @@ class BSDbPostgreSql extends BSDb return pg_connect("host='$server' port={$this->port} user='$user' password='$password' dbname='$database'"); } - // ################################################################### - /** - * Wrapper: pg_pconnect - */ - protected function _pConnect($server, $user, $password, $database) - { - return pg_pconnect("host='$server' port={$this->port} user='$user' password='$password' dbname='$database'"); - } - // ################################################################### /** * Wrapper: pg_escape_string -- 2.43.5