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.');
}
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');
}
$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
$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.',
/// The new table button
$b .= ' <a href="index.php?action=new_table&postaction=edit_table&table=changeme&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 .= ' <a href="index.php?action=new_table_from_mysql&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['newtablefrommysql'] . ']</a>';
} else {
$b .= ' [' . $this->str['newtablefrommysql'] . ']';
// 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);
}
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,
return $success;
}
-?>
\ No newline at end of file
+?>