Merge branch 'MDL-65208-cli-upgrade-is-pending' of https://github.com/brendanheywood/moodle

This commit is contained in:
Adrian Greeve
2019-06-11 09:42:08 +08:00
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -52,7 +52,8 @@ list($options, $unrecognized) = cli_get_params(
'allow-unstable' => false,
'help' => false,
'lang' => $lang,
'verbose-settings' => false
'verbose-settings' => false,
'is-pending' => false,
),
array(
'h' => 'help'
@@ -88,6 +89,8 @@ Options:
--verbose-settings Show new settings values. By default only the name of
new core or plugin settings are displayed. This option
outputs the new values as well as the setting name.
--is-pending If an upgrade is needed it exits with an error code of
2 so it distinct from other types of errors.
-h, --help Print out this help
Example:
@@ -116,6 +119,10 @@ if (!moodle_needs_upgrading()) {
cli_error(get_string('cliupgradenoneed', 'core_admin', $newversion), 0);
}
if ($options['is-pending']) {
cli_error(get_string('cliupgradepending', 'core_admin'), 2);
}
// Test environment first.
list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
if (!$envstatus) {
+1
View File
@@ -132,6 +132,7 @@ $string['cliupgradedefaultheading'] = 'Setting new default values';
$string['cliupgradedefaultverbose'] = 'New setting: {$a->name}, Default value: {$a->defaultsetting}';
$string['cliupgradefinished'] = 'Command line upgrade from {$a->oldversion} to {$a->newversion} completed successfully.';
$string['cliupgradenoneed'] = 'No upgrade needed for the installed version {$a}. Thanks for coming anyway!';
$string['cliupgradepending'] = 'An upgrade is pending';
$string['cliyesnoprompt'] = 'type y (means yes) or n (means no)';
$string['commentsperpage'] = 'Comments displayed per page';
$string['commonactivitysettings'] = 'Common activity settings';