]> git.mjollnir.org Git - moodle.git/commitdiff
Adding some $CFG->dbfamily-s here and there. MDL-7061
authorstronk7 <stronk7>
Fri, 12 Jan 2007 00:06:08 +0000 (00:06 +0000)
committerstronk7 <stronk7>
Fri, 12 Jan 2007 00:06:08 +0000 (00:06 +0000)
admin/index.php
admin/innodb.php
admin/settings/top.php
admin/upgradelogs.php
admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php
auth/ldap/auth.php
group/db/dbsetup.php

index 050be7bb69675f5cce580b75da82eb6dae5604bc..52a8953dde7b9338446c3f844da544185fc159ee 100644 (file)
         error("The PHP server variable 'file_uploads' is not turned On - $documentationlink");
     }
 
-    if (empty($CFG->prefix) && $CFG->dbtype != 'mysql') {  //Enforce prefixes for everybody but mysql
+    if (empty($CFG->prefix) && $CFG->family != 'mysql') {  //Enforce prefixes for everybody but mysql
         error('$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')');
     }
 
-    if ($CFG->dbtype == 'oci8po' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
+    if ($CFG->dbfamily == 'oracle' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
         error('$CFG->prefix maximum allowed length for Oracle DBs is 2cc.');
     }
 
index 6d73b5b49dfc346cda387f58d0a53c7da640a7e6..194917536ade60194d720cd30b965fcd8942366b 100644 (file)
@@ -14,7 +14,7 @@
    admin_externalpage_print_header($adminroot);
    print_heading('Convert all MySQL tables from MYISAM to InnoDB');
 
-   if ($CFG->dbtype != 'mysql') {
+   if ($CFG->dbfamily != 'mysql') {
         notice('This function is for MySQL databases only!', 'index.php');
    }
 
index 58fb07b82624c48a7d07fe4a21cf0bacc30d1548..e638989bf4436d9e20e82a280badd9d911504766 100644 (file)
@@ -31,7 +31,7 @@ $ADMIN->add('root', new admin_category('mnet', get_string('net','mnet')));
 $ADMIN->add('root', new admin_category('reports', get_string('reports')));
 foreach (get_list_of_plugins('admin/report') as $plugin) {
 /// This snippet is temporary until simpletest can be fixed to use xmldb.   See MDL-7377   XXX TODO
-    if ($plugin == 'simpletest' && $CFG->dbtype != 'mysql' && $CFG->dbtype != 'postgres7') {
+    if ($plugin == 'simpletest' && $CFG->dbfamily != 'mysql' && $CFG->dbfamily != 'postgres') {
         continue;
     }
 /// End of removable snippet
index abe4fae9bb9484673fbdaf47ae2814d36ad07ac4..a70327a964909dd5f3d8952d3a5ba99e3809a928 100644 (file)
         $starttime = time();
         $sleeptime = 0;
 
-        if ($CFG->dbtype == "mysql") {
-            $LIKE = "LIKE";
-        } else {
-            $LIKE = "ILIKE";
-        }
+        $LIKE = sql_ilike();
 
         if ($cmcount > 10) {
             print_simple_box('This process may take a very long time ... please be patient and let it finish.',
index 48f2976ec64f71e052eccfadb44a4fab84160458..1dfba4904f11e0a97194ee960a739f9e4671d6c4 100644 (file)
@@ -126,7 +126,7 @@ class edit_xml_file extends XMLDBAction {
             /// The new table button
                 $b .= '&nbsp;<a href="index.php?action=new_table&amp;postaction=edit_table&amp;table=changeme&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['newtable'] . ']</a>';
             /// The new from MySQL button
-                if ($CFG->dbtype == 'mysql') {
+                if ($CFG->dbfamily == 'mysql') {
                     $b .= '&nbsp;<a href="index.php?action=new_table_from_mysql&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['newtablefrommysql'] . ']</a>';
                 } else {
                     $b .= '&nbsp;[' . $this->str['newtablefrommysql'] . ']';
index 301a580039d6cb8800fb1b781004d94f4fb66cd8..f2f7e9c791d2f15989f086bb1a2bb0d3e4f88794 100644 (file)
@@ -413,12 +413,12 @@ class auth_plugin_ldap {
 
         // configure a temp table 
         print "Configuring temp table\n";    
-        if (strtolower($CFG->dbtype) === 'mysql') {
+        if (strtolower($CFG->dbfamily) === 'mysql') {
             // help old mysql versions cope with large temp tables
             execute_sql('SET SQL_BIG_TABLES=1', false); 
             execute_sql('CREATE TEMPORARY TABLE ' . $CFG->prefix .'extuser (idnumber VARCHAR(64), PRIMARY KEY (idnumber)) TYPE=MyISAM',false); 
         }
-        elseif (strtolower($CFG->dbtype) === 'postgres7') {
+        elseif (strtolower($CFG->dbfamily) === 'postgres') {
             $bulk_insert_records = 1; // no support for multiple sets of values
             execute_sql('CREATE TEMPORARY TABLE '.$CFG->prefix.'extuser (idnumber VARCHAR(64), PRIMARY KEY (idnumber))',false); 
         }
index cab2cdca3d1548c408fcaba956adb1a2bfe3e70f..973f799b8ebb348779c4268670b85904eca895bc 100644 (file)
@@ -48,7 +48,7 @@ require_once($CFG->libdir.'/datalib.php');
 function groups_create_database_tables() {
        global $CFG;
 
-    if ('mysql' == $CFG->dbtype) {
+    if ('mysql' == $CFG->dbfamily) {
 
         $createcoursegrouptablesql = "CREATE TABLE IF NOT EXISTS `{$CFG->prefix}groups_courses_groups` (
                             `id` int(10) unsigned NOT NULL auto_increment,
@@ -257,4 +257,4 @@ function groups_db_copy_moodle_group_to_imsgroup($groupid, $courseid) {
     return $success;
 }
 
-?>
\ No newline at end of file
+?>