]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17020 pgsql native driver: use same solution than mssql and oci to disable driver...
authorstronk7 <stronk7>
Wed, 23 Sep 2009 13:42:31 +0000 (13:42 +0000)
committerstronk7 <stronk7>
Wed, 23 Sep 2009 13:42:31 +0000 (13:42 +0000)
lib/dml/pgsql_native_moodle_database.php

index 07631fe5a7f0b1c01dbf3f1ad0704ee618b385de..ee0242b0f1e693bab86e9c1a3b39da23591c51fe 100644 (file)
@@ -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);
     }