Permalink
Browse files

Merge branch 'master' of https://github.com/moodle/moodle

  • Loading branch information...
doraemonyoung committed Apr 29, 2012
2 parents 716d422 + aa753ac commit d0eab62ad58f70fe5d0ccb1590a5bb2f7cf35cc6
Showing 3,864 changed files with 503,493 additions and 495,802 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -76,7 +76,13 @@
}
echo str_pad($table->name, 40). " - ";
- $DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
+ try {
+ $DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
+ } catch (moodle_exception $e) {
+ echo $e->getMessage()."\n";
+ $skipped++;
+ continue;
+ }
echo "DONE\n";
$converted++;
}
@@ -50,7 +50,7 @@ function definition() {
$this->add_action_buttons(false, get_string('addhost', 'mnet'));
}
- function validation($data) {
+ function validation($data, $files) {
global $DB;
$wwwroot = $data['wwwroot'];
@@ -154,7 +154,7 @@ function definition() {
$this->add_action_buttons(false);
}
- function validation($data) {
+ function validation($data, $files) {
$errors = array();
if ($data['oldpublickey'] == $data['public_key']) {
return;
@@ -39,6 +39,15 @@ function definition() {
global $CFG;
$mform =& $this->_form;
+ $mnetprofileimportfields = '';
+ if (isset($CFG->mnetprofileimportfields)) {
+ $mnetprofileimportfields = str_replace(',', ', ', $CFG->mnetprofileimportfields);
+ }
+
+ $mnetprofileexportfields = '';
+ if (isset($CFG->mnetprofileexportfields)) {
+ $mnetprofileexportfields = str_replace(',', ', ', $CFG->mnetprofileexportfields);
+ }
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$fields = mnet_profile_field_options();
@@ -49,15 +58,15 @@ function definition() {
$select = $mform->addElement('select', 'importfields', get_string('importfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
- $mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileimportfields));
+ $mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), $mnetprofileimportfields);
// Fields to export ----------------------------------------------------
$mform->addElement('header', 'export', get_string('exportfields', 'mnet'));
$select = $mform->addElement('select', 'exportfields', get_string('exportfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
- $mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileexportfields));
+ $mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), $mnetprofileexportfields);
$this->add_action_buttons();
}
@@ -36,7 +36,7 @@ class mnet_services_form extends moodleform {
function definition() {
$mform =& $this->_form;
$mnet_peer =& $this->_customdata['peer'];
- $myservices =& mnet_get_service_info($mnet_peer);
+ $myservices = mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
View
@@ -92,8 +92,29 @@
// Add a category for backups
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
- // Create a page for general backup defaults
+ // Create a page for general backups configuration and defaults.
$temp = new admin_settingpage('backupgeneralsettings', new lang_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
+
+ // General configuration section.
+ $temp->add(new admin_setting_configselect('backup/loglifetime', new lang_string('loglifetime', 'backup'), new lang_string('configloglifetime', 'backup'), 30, array(
+ 1 => new lang_string('numdays', '', 1),
+ 2 => new lang_string('numdays', '', 2),
+ 3 => new lang_string('numdays', '', 3),
+ 5 => new lang_string('numdays', '', 5),
+ 7 => new lang_string('numdays', '', 7),
+ 10 => new lang_string('numdays', '', 10),
+ 14 => new lang_string('numdays', '', 14),
+ 20 => new lang_string('numdays', '', 20),
+ 30 => new lang_string('numdays', '', 30),
+ 60 => new lang_string('numdays', '', 60),
+ 90 => new lang_string('numdays', '', 90),
+ 120 => new lang_string('numdays', '', 120),
+ 180 => new lang_string('numdays', '', 180),
+ 365 => new lang_string('numdays', '', 365)
+ )));
+
+ // General defaults section.
+ $temp->add(new admin_setting_heading('generalsettings', new lang_string('generalsettings', 'backup'), ''));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', new lang_string('generalusers','backup'), new lang_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', new lang_string('generalanonymize','backup'), new lang_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
@@ -106,8 +127,10 @@
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
$ADMIN->add('backups', $temp);
-/// "backups" settingpage
+ // Create a page for automated backups configuration and defaults.
$temp = new admin_settingpage('automated', new lang_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
+
+ // Automated configuration section.
$temp->add(new admin_setting_configselect('backup/backup_auto_active', new lang_string('active'), new lang_string('autoactivedescription', 'backup'), 0, array(
0 => new lang_string('autoactivedisabled', 'backup'),
1 => new lang_string('autoactiveenabled', 'backup'),
@@ -139,7 +162,7 @@
500 => '500');
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
-
+ // Automated defaults section.
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
@@ -46,11 +46,17 @@
echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
+ set_time_limit(0);
+
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 ENGINE=INNODB");
+ try {
+ $DB->change_database_structure("ALTER TABLE $fulltable ENGINE=INNODB");
+ } catch (moodle_exception $e) {
+ echo $OUTPUT->notification(s($e->getMessage()).'<br />'.s($e->debuginfo));
+ }
}
$DB->set_debug(false);
}
@@ -1,22 +0,0 @@
-@ECHO OFF
-ECHO Initialising Moodle PHPUnit test environment...
-
-CALL php %~dp0\util.php --diag > NUL 2>&1
-
-IF ERRORLEVEL 133 GOTO drop
-IF ERRORLEVEL 132 GOTO install
-IF ERRORLEVEL 1 GOTO unknown
-GOTO done
-
-:drop
-CALL php %~dp0\util.php --drop
-IF ERRORLEVEL 1 GOTO done
-
-:install
-CALL php %~dp0\util.php --install
-GOTO done
-
-:unknown
-CALL php %~dp0\util.php --diag
-
-:done
@@ -43,13 +43,13 @@
if ($code == 0) {
// everything is ready
-} else if ($code == 132) {
+} else if ($code == PHPUNIT_EXITCODE_INSTALL) {
passthru("php util.php --install", $code);
if ($code != 0) {
exit($code);
}
-} else if ($code == 133) {
+} else if ($code == PHPUNIT_EXITCODE_REINSTALL) {
passthru("php util.php --drop", $code);
passthru("php util.php --install", $code);
if ($code != 0) {
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
-CLIDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-UTIL="$CLIDIR/util.php"
-
-echo "Initialising Moodle PHPUnit test environment..."
-
-DIGERROR=`php $UTIL --diag`
-DIAG=$?
-if [ $DIAG -eq 132 ] ; then
- php $UTIL --install
-else
- if [ $DIAG -eq 133 ] ; then
- php $UTIL --drop
- RESULT=$?
- if [ $RESULT -gt 0 ] ; then
- exit $RESULT
- fi
- php $UTIL --install
- else
- if [ $DIAG -gt 0 ] ; then
- echo $DIGERROR
- exit $DIAG
- fi
- fi
-fi
-
-php $UTIL --buildconfig
@@ -17,14 +17,7 @@
/**
* PHPUnit related utilities.
*
- * Exit codes:
- * 0 - success
- * 1 - general error
- * 130 - missing PHPUnit library error
- * 131 - configuration problem
- * 132 - install new test database
- * 133 - drop existing data before installing
- * 134 - can not create main phpunit.xml
+ * Exit codes: {@see phpunit_bootstrap_error()}
*
* @package tool_phpunit
* @copyright 2012 Petr Skoda {@link http://skodak.org}
@@ -72,12 +65,8 @@
}
// verify PHPUnit libs are loaded
-if (!@include_once('PHPUnit/Autoload.php')) {
- phpunit_bootstrap_error(130);
-}
-
-if (!@include_once('PHPUnit/Extensions/Database/Autoload.php')) {
- phpunit_bootstrap_error(130);
+if (!include_once('PHPUnit/Autoload.php')) {
+ phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
}
if ($options['run']) {
@@ -147,7 +136,7 @@
if (phpunit_util::build_config_file()) {
exit(0);
} else {
- phpunit_bootstrap_error(134);
+ phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGWARNING, 'Can not create phpunit.xml configuration file, verify dirroot permissions');
}
} else if ($drop) {
@@ -67,7 +67,7 @@
if ($code == 0) {
// everything is ready
- } else if ($code == 132) {
+ } else if ($code == PHPUNIT_EXITCODE_INSTALL) {
tool_phpunit_header();
echo $OUTPUT->box_start('generalbox');
echo '<pre>';
@@ -87,7 +87,7 @@
echo $OUTPUT->footer();
die();
- } else if ($code == 133) {
+ } else if ($code == PHPUNIT_EXITCODE_REINSTALL) {
tool_phpunit_header();
echo $OUTPUT->box_start('generalbox');
echo '<pre>';
@@ -5,7 +5,7 @@ With a lot of question attempts, doing the whole conversion on upgrade is very
slow. The plugin can help with that in various ways.
-1. It provies a report of how much data there is to upgrade.
+1. It provides a report of how much data there is to upgrade.
2. It can extract test-cases from the database. This can help you report bugs
in the upgrade process to the developers.
@@ -35,3 +35,9 @@ subsequently been modified) so you can re-upgrade them. This may allow you to
recover from a buggy upgrade.
9. Finally, you can still use the extract test-cases script to help report bugs.
+
+
+Manual upgrades can be processed via the web interface or the command line tool
+cliupgrade.php. To run cliupgrade.php, use a command similar to:
+sudo -u www-data /usr/bin/php admin/tool/qeupgradehelper/cli/convert.php -h
+The -h flag will show the options for running the tool.
Oops, something went wrong.

0 comments on commit d0eab62

Please sign in to comment.