]> git.mjollnir.org Git - moodle.git/commitdiff
Moving set_dbfamily() from dmllib.php to setuplib.php as it's
authorstronk7 <stronk7>
Sat, 13 Jan 2007 10:44:58 +0000 (10:44 +0000)
committerstronk7 <stronk7>
Sat, 13 Jan 2007 10:44:58 +0000 (10:44 +0000)
needed in early stages and we don't want the installer to
depend of dmllib.

install.php
lib/dmllib.php
lib/setuplib.php

index a1ac5f7c2ca80e0372d31c3f7bb7fa48f897b9ff..c7109d83bb4e031772e58f94a31153fc4e92be2a 100644 (file)
@@ -125,7 +125,6 @@ require_once('./lib/adminlib.php');
 require_once('./lib/setuplib.php');
 require_once('./lib/moodlelib.php');
 require_once('./lib/weblib.php');
-require_once('./lib/dmllib.php');
 require_once('./lib/deprecatedlib.php');
 require_once('./lib/adodb/adodb.inc.php');
 require_once('./lib/environmentlib.php');
index d8669915f62d752e2410a501958bcc377a2b3aa4..38ae9ba47d11988e4ce804a8e5d2c971187667d4 100644 (file)
@@ -1821,50 +1821,6 @@ function configure_dbconnection() {
     set_dbfamily();
 }
 
-/**
- * This internal function sets and returns the proper value for $CFG->dbfamily based on $CFG->dbtype
- * It's called by configure_dbconnection() and at install time. Shouldn't be used
- * in other places. Code should rely on dbfamily to perform conditional execution
- * instead of using dbtype directly. This allows quicker adoption of different
- * drivers going against the same DB backend.
- *
- * This function must contain the init code needed for each dbtype supported.
- *
- * return string dbfamily value (mysql, postgres, oracle, mssql)
- */
-function set_dbfamily() {
-
-    global $CFG, $INSTALL;
-
-    // Since this function is also used during installation process, i.e. during install.php before $CFG->dbtype is set.
-    // we need to get dbtype from the right variable 
-    if (!empty($INSTALL['dbtype'])) {
-        $dbtype = $INSTALL['dbtype'];
-    } else {
-        $dbtype = $CFG->dbtype;
-    }
-
-    switch ($dbtype) {
-        case 'mysql':
-        case 'mysqli':
-            $CFG->dbfamily='mysql';
-            break;
-        case 'postgres7':
-            $CFG->dbfamily='postgres';
-            break;
-        case 'mssql':
-        case 'mssql_n':
-        case 'odbc_mssql':
-            $CFG->dbfamily='mssql';
-            break;
-        case 'oci8po':
-            $CFG->dbfamily='oracle';
-            break;
-    }
-
-    return $CFG->dbfamily;
-}
-
 /**
  * This function will handle all the records before being inserted/updated to DB for Oracle
  * installations. This is because the "special feature" of Oracle where the empty string is
index 788bfad9b15d9c1bf7a9c2e8b297e978f0a86005..d564d0d3404a85126dced6ad4443ec0f872167c6 100644 (file)
@@ -202,6 +202,50 @@ function setup_is_unicodedb() {
     return $unicodedb;
 }
 
+/**
+ * This internal function sets and returns the proper value for $CFG->dbfamily based on $CFG->dbtype
+ * It's called by configure_dbconnection() and at install time. Shouldn't be used
+ * in other places. Code should rely on dbfamily to perform conditional execution
+ * instead of using dbtype directly. This allows quicker adoption of different
+ * drivers going against the same DB backend.
+ *
+ * This function must contain the init code needed for each dbtype supported.
+ *
+ * return string dbfamily value (mysql, postgres, oracle, mssql)
+ */
+function set_dbfamily() {
+
+    global $CFG, $INSTALL;
+
+    // Since this function is also used during installation process, i.e. during install.php before $CFG->dbtype is set.
+    // we need to get dbtype from the right variable 
+    if (!empty($INSTALL['dbtype'])) {
+        $dbtype = $INSTALL['dbtype'];
+    } else {
+        $dbtype = $CFG->dbtype;
+    }
+
+    switch ($dbtype) {
+        case 'mysql':
+        case 'mysqli':
+            $CFG->dbfamily='mysql';
+            break;
+        case 'postgres7':
+            $CFG->dbfamily='postgres';
+            break;
+        case 'mssql':
+        case 'mssql_n':
+        case 'odbc_mssql':
+            $CFG->dbfamily='mssql';
+            break;
+        case 'oci8po':
+            $CFG->dbfamily='oracle';
+            break;
+    }
+
+    return $CFG->dbfamily;
+}
+
 function init_memcached() {
     global $CFG, $MCACHE;