forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-14679 ok, here is the big patch with new dmllib and ddlib API, so…
…me code is already converted, XML db editor works; see tracker for details of regressions and TODOs
- Loading branch information
skodak
committed
May 15, 2008
1 parent
469dcbc
commit f33e1ed
Showing
112 changed files
with
8,187 additions
and
6,558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
<?php | ||
|
||
require_once('../config.php'); | ||
require_once($CFG->libdir.'/adminlib.php'); | ||
require_once('../config.php'); | ||
require_once($CFG->libdir.'/adminlib.php'); | ||
|
||
admin_externalpage_setup('toinodb'); | ||
admin_externalpage_setup('toinodb'); | ||
|
||
$confirm = optional_param('confirm', 0, PARAM_BOOL); | ||
$confirm = optional_param('confirm', 0, PARAM_BOOL); | ||
|
||
require_login(); | ||
require_login(); | ||
|
||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); | ||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); | ||
|
||
admin_externalpage_print_header(); | ||
print_heading('Convert all MySQL tables from MYISAM to InnoDB'); | ||
admin_externalpage_print_header(); | ||
print_heading('Convert all MySQL tables from MYISAM to InnoDB'); | ||
|
||
if ($CFG->dbfamily != 'mysql') { | ||
if ($CFG->dbfamily != 'mysql') { | ||
notice('This function is for MySQL databases only!', 'index.php'); | ||
} | ||
|
||
if (data_submitted() and $confirm and confirm_sesskey()) { | ||
|
||
notify('Please be patient and wait for this to complete...', 'notifysuccess'); | ||
|
||
if ($tables = $db->MetaTables()) { | ||
$db->debug = true; | ||
foreach ($tables as $table) { | ||
execute_sql("ALTER TABLE $table TYPE=INNODB; "); | ||
} | ||
$db->debug = false; | ||
} | ||
notify('... done.', 'notifysuccess'); | ||
print_continue('index.php'); | ||
admin_externalpage_print_footer(); | ||
|
||
} else { | ||
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey()); | ||
notice_yesno('Are you sure you want convert all your tables to the InnoDB format?', | ||
'innodb.php', 'index.php', $optionsyes, NULL, 'post', 'get'); | ||
admin_externalpage_print_footer(); | ||
} | ||
} | ||
|
||
if (data_submitted() and $confirm and confirm_sesskey()) { | ||
|
||
notify('Please be patient and wait for this to complete...', 'notifysuccess'); | ||
|
||
if ($tables = $DB->get_tables()) { | ||
$DB->set_debug(true); | ||
foreach ($tables as $table) { | ||
$fulltable = $DB->get_prefix().$table; | ||
$DB->change_database_structure("ALTER TABLE $fulltable TYPE=INNODB"); | ||
} | ||
$DB->set_debug(false); | ||
} | ||
notify('... done.', 'notifysuccess'); | ||
print_continue('index.php'); | ||
admin_externalpage_print_footer(); | ||
|
||
} else { | ||
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey()); | ||
notice_yesno('Are you sure you want convert all your tables to the InnoDB format?', | ||
'innodb.php', 'index.php', $optionsyes, NULL, 'post', 'get'); | ||
admin_externalpage_print_footer(); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.