Commit cbb9e9b8 authored by Eloy Lafuente's avatar Eloy Lafuente
Browse files

MDL-25310 backup - some minor tasks related to cleaning/old options

parent 49da759b
......@@ -12,9 +12,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$englobalsearch = new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0);
$temp->add(new admin_setting_configcheckbox('experimentalsplitrestore', get_string('experimentalsplitrestore', 'admin'), get_string('configexperimentalsplitrestore', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enableimsccimport', get_string('enable_cc_import', 'imscc'), get_string('enable_cc_import_description', 'imscc'), 0));
//TODO: Re-enable cc-import once re-implemented in 2.0.x
//$temp->add(new admin_setting_configcheckbox('enableimsccimport', get_string('enable_cc_import', 'imscc'), get_string('enable_cc_import_description', 'imscc'), 0));
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', get_string('enablesafebrowserintegration', 'admin'), get_string('configenablesafebrowserintegration', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', get_string('enablegroupmembersonly', 'admin'), get_string('configenablegroupmembersonly', 'admin'), 0));
......@@ -204,7 +204,6 @@ $string['configenablewebservices'] = 'Web services enable other systems to log i
$string['configenablewsdocumentation'] = 'Enable auto-generation of web services documentation. A user can access to his own documentation on his security keys page {$a}. It displays the documentation for the enabled protocols only.';
$string['configerrorlevel'] = 'Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.';
$string['configexcludeoldflashclients'] = 'Some versions of the Adobe Flash plugin are known to be vulnerable to attacks from malicious Flash content. You can specify a minimum supported version here, and Moodle will not show Flash files to users with lower versions. Instead they will see an alternate Flash file telling them how to upgrade. Leave this empty to disable all checks.';
$string['configexperimentalsplitrestore'] = 'If enabled, course backup files will be checked for XML errors and split into smaller parts for use in the restore process. This will result in improvements to restore robustness and execution times, particularly for medium to large course backups.';
$string['configextendedusernamechars'] = 'Enable this setting to allow students to use any characters in their usernames (note this does not affect their actual names). The default is "false" which restricts usernames to be alphanumeric lowercase characters, underscore (_), hyphen (-), period (.) or at symbol (@).';
$string['configextramemorylimit'] = 'Some scripts like search, backup/restore or cron require more memory. Set higher values for large sites.';
$string['configextrauserselectorfields'] = 'Select which fields are searched and displayed, in addition to full names, when selecting users, for example when assigning roles or when adding users to a group. For security reasons, it is recommended that the username field is NOT selected.';
......@@ -518,7 +517,6 @@ $string['exceptions'] = 'exceptions';
$string['excludeoldflashclients'] = 'Required Flash player version';
$string['experimental'] = 'Experimental';
$string['experimentalsettings'] = 'Experimental settings';
$string['experimentalsplitrestore'] = 'Experimental split restore';
$string['extendedusernamechars'] = 'Allow extended characters in usernames';
$string['extramemorylimit'] = 'Extra PHP memory limit';
$string['extrauserselectorfields'] = 'When selecting users, search and display';
......@@ -266,6 +266,25 @@ function cron_run() {
// Delete old backup_controllers and logs
if (!empty($CFG->loglifetime)) { // value in days
$loglifetime = $timenow - ($CFG->loglifetime * 3600 * 24);
// Delete child records from backup_logs
$DB->execute("DELETE FROM {backup_logs}
FROM {backup_controllers} bc
WHERE bc.backupid = {backup_logs}.backupid
AND bc.timecreated < ?)", array($loglifetime));
// Delete records from backup_controllers
$DB->execute("DELETE FROM {backup_controllers}
WHERE timecreated < ?", array($loglifetime));
mtrace("Deleted old backup records");
/// Delete old cached texts
......@@ -483,4 +502,4 @@ function cron_run() {
$difftime = microtime_diff($starttime, microtime());
mtrace("Execution took ".$difftime." seconds");
\ No newline at end of file
......@@ -5469,6 +5469,14 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
upgrade_main_savepoint(true, 2010111000);
if ($oldversion < 2010111702) {
// Clean up the old experimental split restore no loger used
upgrade_main_savepoint(true, 2010111702);
return true;
......@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2010111701; // YYYYMMDD = date of the last version bump
$version = 2010111702; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 RC2 (Build: 20101118)'; // Human-friendly version name
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment