From 4103f151f994d43fc2464b7dcd752c112e85eba9 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 2 Nov 2009 14:33:46 +0000 Subject: [PATCH] MDL-20715 fixed notice from dml native oci driver when php driver not installed --- lib/dml/oci_native_moodle_database.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index 1b7d7ae4c6..b89b1cacb4 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -41,8 +41,7 @@ class oci_native_moodle_database extends moodle_database { private $temptables; // Control existing temptables (oci_native_moodle_temptables object) private $last_stmt_error = null; // To store stmt errors and enable get_last_error() to detect them - private $commit_status = OCI_COMMIT_ON_SUCCESS; // Autocommit ON by default. Switching to OFF (OCI_DEFAULT) - // when playing with transactions + private $commit_status = null; // default value initialised in connect method, we need the driver to be present private $last_error_reporting; // To handle oci driver default verbosity private $unique_session_id; // To store unique_session_id. Needed for temp tables unique naming @@ -169,6 +168,12 @@ class oci_native_moodle_database extends moodle_database { throw new dml_exception('dbdriverproblem', $driverstatus); } + // Autocommit ON by default. + // Switching to OFF (OCI_DEFAULT), when playing with transactions + // please note this thing is not defined if oracle driver not present in PHP + // which means it can not be used as default value of object property! + $this->commit_status = OCI_COMMIT_ON_SUCCESS; + $this->store_settings($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions); unset($this->dboptions['dbsocket']); -- 2.39.5