MDL-31832 CLI upgrade checks if the upgrade is actually needed
Conflicts: admin/cli/upgrade.php
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
b23ffc0937
commit
01af07849e
@@ -93,6 +93,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
|
||||
if (!check_moodle_environment(normalize_version($release), $environment_results, false, ENV_SELECT_RELEASE)) {
|
||||
$errors = environment_get_errors($environment_results);
|
||||
|
||||
@@ -114,6 +114,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';
|
||||
|
||||
Reference in New Issue
Block a user