Skip to content

Commit

Permalink
MDL-46167 admin_cli: allow skipping of database installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mackensen committed Jul 4, 2015
1 parent e5eefbb commit 096fd59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion admin/cli/install.php
Expand Up @@ -80,6 +80,7 @@
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:
Expand Down Expand Up @@ -260,6 +261,7 @@
'non-interactive' => false,
'agree-license' => false,
'allow-unstable' => false,
'skip-database' => false,
'help' => false
),
array(
Expand Down Expand Up @@ -772,7 +774,11 @@
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
1 change: 1 addition & 0 deletions lang/en/install.php
Expand Up @@ -47,6 +47,7 @@
$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 ...';
Expand Down

0 comments on commit 096fd59

Please sign in to comment.