MDL-31832 CLI upgrade checks if the upgrade is actually needed

This commit is contained in:
David Mudrak
2012-03-07 11:02:10 +01:00
committed by Eloy Lafuente (stronk7)
parent 251ed425e4
commit 1acc431b98
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -92,6 +92,10 @@ if ($version < $CFG->version) {
$oldversion = "$CFG->release ($CFG->version)";
$newversion = "$release ($version)";
if (!moodle_needs_upgrading()) {
cli_error(get_string('cliupgradenoneed', 'core_admin', $newversion), 63);
}
// Test environment first.
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {
+1
View File
@@ -105,6 +105,7 @@ $string['cliunknowoption'] = 'Unrecognised options:
{$a}
Please use --help option.';
$string['cliupgradefinished'] = 'Command line upgrade completed successfully.';
$string['cliupgradenoneed'] = 'No upgrade needed for the installed version {$a}. Thanks for coming anyway!';
$string['cliyesnoprompt'] = 'type y (means yes) or n (means no)';
$string['commentsperpage'] = 'Comments displayed per page';
$string['commonfiltersettings'] = 'Common filter settings';