From a9ad1798ba014448f40a495125d8eb730a4304ce Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 23 Sep 2009 13:33:42 +0000 Subject: [PATCH] MDL-17491 oracle native driver: prevent verbosity of the driver --- lib/dml/oci_native_moodle_database.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index b60d0dafa9..b428509a26 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -42,6 +42,8 @@ class oci_native_moodle_database extends moodle_database { private $commit_status = OCI_COMMIT_ON_SUCCESS; // Autocommit ON by default. Switching to OFF (OCI_DEFAULT) // when playing with transactions + protected $last_error_reporting; // To handle oci driver default verbosity + /** * Detects if all needed PHP stuff installed. * Note: can be used before connect() @@ -200,6 +202,8 @@ class oci_native_moodle_database extends moodle_database { */ protected function query_start($sql, array $params=null, $type, $extrainfo=null) { parent::query_start($sql, $params, $type, $extrainfo); + // oci driver tents to send debug to output, we do not need that ;-) + $this->last_error_reporting = error_reporting(0); } /** @@ -208,6 +212,8 @@ class oci_native_moodle_database extends moodle_database { * @return void */ protected function query_end($result, $stmt=null) { + // reset original debug level + error_reporting($this->last_error_reporting); if ($stmt and $result === false) { // Look for stmt error and store it if (is_resource($stmt)) { -- 2.39.5