aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-03-02 06:35:25 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2011-03-06 20:16:17 -0500
commit17693c2802c92297251f5cd94cc5452f5e54eb0b (patch)
tree84fe35b62de845904d2dd116661fe45bc6c54e04 /phpBB/includes/db
parenta4100fe7094aaa5377065d2f25ca8d0fa2ff6bf8 (diff)
downloadforums-17693c2802c92297251f5cd94cc5452f5e54eb0b.tar
forums-17693c2802c92297251f5cd94cc5452f5e54eb0b.tar.gz
forums-17693c2802c92297251f5cd94cc5452f5e54eb0b.tar.bz2
forums-17693c2802c92297251f5cd94cc5452f5e54eb0b.tar.xz
forums-17693c2802c92297251f5cd94cc5452f5e54eb0b.zip
[ticket/10057] Use a class for error collection.
Replaced error collection functions with a class for a cleaner implementation. PHPBB3-10057
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/postgres.php10
1 files changed, 6 insertions, 4 deletions
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);
}