]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20715 fixed notice from dml native oci driver when php driver not installed
authorPetr Skoda <skodak@moodle.org>
Mon, 2 Nov 2009 14:33:46 +0000 (14:33 +0000)
committerPetr Skoda <skodak@moodle.org>
Mon, 2 Nov 2009 14:33:46 +0000 (14:33 +0000)
lib/dml/oci_native_moodle_database.php

index 1b7d7ae4c66314aa78c4bf2f7c2fa4592f0f5982..b89b1cacb43060d14b6e3f3b8bbf81ef498c4c10 100644 (file)
@@ -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']);