MDL-46167 admin_cli: allow skipping of database installation

This commit is contained in:
Charles Fulton 2014-06-26 14:27:07 -07:00 committed by Charles Fulton
parent e5eefbbf01
commit 096fd59653
2 changed files with 8 additions and 1 deletions

View File

@ -80,6 +80,7 @@ Options:
required in non-interactive mode.
--allow-unstable Install even if the version is not marked as stable yet,
required in non-interactive mode.
--skip-database Stop the installation before installing the database.
-h, --help Print out this help
Example:
@ -260,6 +261,7 @@ list($options, $unrecognized) = cli_get_params(
'non-interactive' => false,
'agree-license' => false,
'allow-unstable' => false,
'skip-database' => false,
'help' => false
),
array(
@ -772,7 +774,11 @@ if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
cli_error(get_string('pluginschecktodo', 'admin'));
}
install_cli_database($options, $interactive);
if (!$options['skip-database']) {
install_cli_database($options, $interactive);
} else {
echo get_string('cliskipdatabase', 'install')."\n";
}
echo get_string('cliinstallfinished', 'install')."\n";
exit(0); // 0 means success

View File

@ -47,6 +47,7 @@ $string['clialreadyinstalled'] = 'The configuration file config.php already exis
$string['cliinstallfinished'] = 'Installation completed successfully.';
$string['cliinstallheader'] = 'Moodle {$a} command line installation program';
$string['climustagreelicense'] = 'In non interactive mode you must agree to license by specifying --agree-license option';
$string['cliskipdatabase'] = 'Skipping database installation.';
$string['clitablesexist'] = 'Database tables already present, cli installation can not continue.';
$string['compatibilitysettings'] = 'Checking your PHP settings ...';
$string['compatibilitysettingshead'] = 'Checking your PHP settings ...';