MDL-17020 pgsql native driver: use same solution than mssql and oci to disable driver verbosity
This commit is contained in:
@@ -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.
|
||||
@@ -209,7 +209,7 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,8 +218,8 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user