From e76cd850177fefae34c570e5b49c0ba18955c3b5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 30 Mar 2020 11:37:58 +0300 Subject: [ci skip] Fix #5906 --- system/database/drivers/postgre/postgre_driver.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'system') diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 19bd775d0..cfd793339 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -78,22 +78,12 @@ class CI_DB_postgre_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Class constructor + * Build DSN * - * Creates a DSN string to be used for db_connect() and db_pconnect() - * - * @param array $params * @return void */ - public function __construct($params) + protected function _build_dsn() { - parent::__construct($params); - - if ( ! empty($this->dsn)) - { - return; - } - $this->dsn === '' OR $this->dsn = ''; if (strpos($this->hostname, '/') !== FALSE) @@ -149,6 +139,7 @@ class CI_DB_postgre_driver extends CI_DB { */ public function db_connect($persistent = FALSE) { + empty($this->dsn) OR $this->_build_dsn(); $this->conn_id = ($persistent === TRUE) ? pg_pconnect($this->dsn) : pg_connect($this->dsn); -- cgit v1.2.3-24-g4f1b