Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moving set_dbfamily() from dmllib.php to setuplib.php as it's

needed in early stages and we don't want the installer to
depend of dmllib.
  • Loading branch information...
commit 1d5c40048a7a74c82c658e938f36ad482999ecd1 1 parent 3488d0e
stronk7 authored
Showing with 44 additions and 45 deletions.
  1. +0 −1  install.php
  2. +0 −44 lib/dmllib.php
  3. +44 −0 lib/setuplib.php
View
1  install.php
@@ -125,7 +125,6 @@
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');
View
44 lib/dmllib.php
@@ -1822,50 +1822,6 @@ function configure_dbconnection() {
}
/**
- * 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
* equal to NULL and this presents a problem with all our currently NOT NULL default '' fields.
View
44 lib/setuplib.php
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.