Skip to content

Commit

Permalink
MDL-17020 pgsql native driver: use same solution than mssql and oci t…
Browse files Browse the repository at this point in the history
…o disable driver verbosity
  • Loading branch information
stronk7 committed Sep 23, 2009
1 parent 5c08b24 commit 190ff43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/dml/pgsql_native_moodle_database.php
Expand Up @@ -36,7 +36,7 @@ class pgsql_native_moodle_database extends moodle_database {
protected $pgsql = null;
protected $bytea_oid = null;

protected $last_debug;
protected $last_error_reporting; // To handle pgsql driver default verbosity

/**
* Detects if all needed PHP stuff installed.
Expand Down Expand Up @@ -209,7 +209,7 @@ public function dispose() {
protected function query_start($sql, array $params=null, $type, $extrainfo=null) {
parent::query_start($sql, $params, $type, $extrainfo);
// pgsql driver tents to send debug to output, we do not need that ;-)
$this->last_debug = error_reporting(0);
$this->last_error_reporting = error_reporting(0);
}

/**
Expand All @@ -218,8 +218,8 @@ protected function query_start($sql, array $params=null, $type, $extrainfo=null)
* @return void
*/
protected function query_end($result) {
//reset original debug level
error_reporting($this->last_debug);
// reset original debug level
error_reporting($this->last_error_reporting);
parent::query_end($result);
}

Expand Down

0 comments on commit 190ff43

Please sign in to comment.