From 7b37ec03812e95af3d596d6147ddeeac64a68058 Mon Sep 17 00:00:00 2001 From: Charles Fulton Date: Sat, 12 Jan 2019 15:16:39 -0500 Subject: [PATCH] MDL-64561 install: show help text before database check --- admin/cli/install_database.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/cli/install_database.php b/admin/cli/install_database.php index 0dd61229d68..8b5fe93b09c 100644 --- a/admin/cli/install_database.php +++ b/admin/cli/install_database.php @@ -82,11 +82,6 @@ require_once($CFG->libdir.'/installlib.php'); require_once($CFG->libdir.'/adminlib.php'); require_once($CFG->libdir.'/componentlib.class.php'); -// make sure no tables are installed yet -if ($DB->get_tables() ) { - cli_error(get_string('clitablesexist', 'install')); -} - $CFG->early_install_lang = true; get_string_manager(true); @@ -109,12 +104,17 @@ list($options, $unrecognized) = cli_get_params( ) ); - +// We show help text even if tables are installed. if ($options['help']) { echo $help; die; } +// Make sure no tables are installed yet. +if ($DB->get_tables() ) { + cli_error(get_string('clitablesexist', 'install')); +} + if (!$options['agree-license']) { cli_error('You have to agree to the license. --help prints out the help'); // TODO: localize }