From 17693c2802c92297251f5cd94cc5452f5e54eb0b Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 2 Mar 2011 06:35:25 -0500 Subject: [ticket/10057] Use a class for error collection. Replaced error collection functions with a class for a cleaner implementation. PHPBB3-10057 --- phpBB/includes/db/postgres.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/db') diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index c1dc7f7e2b..a8dc3dd8ee 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -85,7 +85,8 @@ class dbal_postgres extends dbal { return $this->sql_error('pg_pconnect function does not exist, is pgsql extension installed?'); } - phpbb_start_error_collection(); + $collector = new phpbb_error_collector; + $collector->install(); $this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW); } else @@ -94,11 +95,12 @@ class dbal_postgres extends dbal { return $this->sql_error('pg_connect function does not exist, is pgsql extension installed?'); } - phpbb_start_error_collection(); + $collector = new phpbb_error_collector; + $collector->install(); $this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW); } - $errors = phpbb_stop_error_collection(); + $collector->uninstall(); if ($this->db_connect_id) { @@ -114,7 +116,7 @@ class dbal_postgres extends dbal return $this->db_connect_id; } - $errors = phpbb_format_collected_errors($errors); + $errors = $collector->format_errors(); return $this->sql_error($errors); } -- cgit v1.2.1