$CFG->dataroot = str_replace('\\', '/', dirname(dirname(dirname(__FILE__))).'/moodledata');
$CFG->docroot = 'http://docs.moodle.org';
$CFG->directorypermissions = 00777;
-//$CFG->running_installer = true;
+//$CFG->running_installer = true; //TODO: uncomment when install lang packs are regenerated
$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
$CFG->admin = array_pop($parts);
}
}
}
-unset($CFG->running_installer); // we use full lang packs from now on
-
// ask for db type - show only drivers available
if ($interactive) {
cli_separator();
if (!$options['agree-license']) {
echo "Do you agree to Moodle license blah blah blah?\n"; //TODO: localize and use real license
- $input = cli_input('Type yes or y if you agree, ctrl+c if not', '', array('yes', 'y')); // TODO: localize including yes/y
+ $prompt = get_string('cliyesnoprompt', 'admin');
+ $input = cli_input($prompt, '', array('n', 'y'));
+ if ($input == get_string('clianswerno', 'admin')) {
+ exit(1);
+ }
}
} else {
if (!$options['agree-license']) {
- cli_error('You must aggree to license by specifying --agree-license'); //TODO: localize
+ cli_error(get_string('climustagreelicense', 'install'));
}
}
if (!file_exists($configfile)) {
cli_error('Can not create config file.');
-} else if ($interactive) {
- cli_separator();
- echo "config.php created\n";
}
// return back to original dir before executing setup.php chich changes the dir again
require($CFG->dirroot.'/version.php');
if ($DB->get_tables() ) {
- cli_error('Database tables already present, cli installation can not continue.');
+ cli_error(get_string('clitablesexist', 'install'));
}
if (!$DB->setup_is_unicodedb()) {
if ($interactive) {
cli_separator();
- echo get_string('databasesetup')."\n";
+ cli_heading(get_string('databasesetup'));
}
// install core
admin_apply_default_settings(NULL, true);
set_config('registerauth', '');
-echo "yay!!!\n";
-
-exit(0); // 0 means success
\ No newline at end of file
+echo get_string('cliinstallfinished', 'install')."\n";
+exit(0); // 0 means success
$string['clamfailureonupload'] = 'On clam AV failure';
$string['cleanup'] = 'Cleanup';
$string['cliincorrectvalueerror'] = 'Error, incorrect value \"$a->value\" for \"$a->option\"';
+$string['clianswerno'] = 'n';
+$string['cliansweryes'] = 'y';
$string['cliincorrectvalueretry'] = 'Incorrect value, please retry';
$string['clitypevalue'] = 'type value';
$string['clitypevaluedefault'] = 'type value, press Enter to use default value ($a)';
+$string['cliyesnoprompt'] = 'type y (means yes) or n (means no)';
$string['cliunknowoption'] = "Unrecognized options:\n \$a\n. Please use --help option.";
$string['commonfiltersettings'] = 'Common filter settings';
$string['commonsettings'] = 'Common settings';
$string['chooselanguagesub'] = 'Please choose a language for the installation. This language will also be used as the default language for the site, though it may be changed later.';
$string['cliadminpassword'] = 'New admin user password';
$string['clialreadyinstalled'] = 'File config.php already exists, please use admin/cli/upgrade.php if you want to upgrade your site.';
+$string['cliinstallfinished'] = 'Installation completed successfully.';
$string['cliinstallheader'] = 'Moodle $a command line installation program';
+$string['climustagreelicense'] = 'In non interactive mode you must aggree to license by specifying --agree-license option';
+$string['clitablesexist'] = 'Database tables already present, cli installation can not continue.';
$string['compatibilitysettings'] = 'Checking your PHP settings ...';
$string['compatibilitysettingshead'] = 'Checking your PHP settings ...';
$string['compatibilitysettingssub'] = 'Your server should pass all these tests to make Moodle run properly';