// We overwrite current theme css, because during install we could not have a working mod_rewrite
// so we could not have a css at all. Here we set a static css file for the install procedure pages
- $a->config['system']['theme'] = "../install";
+
+ $a->setConfigValue('system', 'value', '../install');
$a->theme['stylesheet'] = System::baseUrl()."/view/install/style.css";
Install::setInstallMode();
$phpath = notags(trim($_POST['phpath']));
require_once("include/dba.php");
- if (!dba::connect($dbhost, $dbuser, $dbpass, $dbdata, true)) {
+ if (!dba::connect($dbhost, $dbuser, $dbpass, $dbdata)) {
$a->data['db_conn_failed'] = true;
}
$timezone = notags(trim($_POST['timezone']));
$language = notags(trim($_POST['language']));
$adminmail = notags(trim($_POST['adminmail']));
- $rino = 1;
// connect to db
dba::connect($dbhost, $dbuser, $dbpass, $dbdata);
- Install::install($urlpath, $dbhost, $dbuser, $dbpass, $dbdata, $phpath, $timezone, $language, $adminmail, $rino);
+ Install::install($urlpath, $dbhost, $dbuser, $dbpass, $dbdata, $phpath, $timezone, $language, $adminmail);
return;
break;
switch ($install_wizard_pass) {
case 1: { // System check
+ $phpath = defaults($_POST, 'phpath', 'php');
- $checks = [];
-
- check_funcs($checks);
-
- check_imagik($checks);
-
- check_htconfig($checks);
-
- check_smarty3($checks);
-
- check_keys($checks);
-
- if (x($_POST, 'phpath')) {
- $phpath = notags(trim($_POST['phpath']));
- }
-
- check_php($phpath, $checks);
-
- check_htaccess($checks);
-
- /// @TODO Maybe move this out?
- function check_passed($v, $c) {
- if ($c['required']) {
- $v = $v && $c['status'];
- }
- return $v;
- }
- $checkspassed = array_reduce($checks, "check_passed", true);
-
-
+ list($checks, $checkspassed) = Install::check($phpath);
$tpl = get_markup_template('install_checks.tpl');
$o .= replace_macros($tpl, [
case 2: { // Database config
- $dbhost = ((x($_POST, 'dbhost')) ? notags(trim($_POST['dbhost'])) : 'localhost');
- $dbuser = notags(trim($_POST['dbuser']));
- $dbpass = notags(trim($_POST['dbpass']));
- $dbdata = notags(trim($_POST['dbdata']));
- $phpath = notags(trim($_POST['phpath']));
-
- $adminmail = notags(trim($_POST['adminmail']));
+ $dbhost = notags(trim(defaults($_POST, 'dbhost' , 'localhost')));
+ $dbuser = notags(trim(defaults($_POST, 'dbuser' , '' )));
+ $dbpass = notags(trim(defaults($_POST, 'dbpass' , '' )));
+ $dbdata = notags(trim(defaults($_POST, 'dbdata' , '' )));
+ $phpath = notags(trim(defaults($_POST, 'phpath' , '' )));
+ $adminmail = notags(trim(defaults($_POST, 'adminmail', '' )));
$tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, [
'$dbdata' => ['dbdata', L10n::t('Database Name'), $dbdata, '', 'required'],
'$adminmail' => ['adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
-
-
'$lbl_10' => L10n::t('Please select a default timezone for your website'),
'$baseurl' => System::baseUrl(),
'$phpath' => $phpath,
'$submit' => L10n::t('Submit'),
-
]);
return $o;
}; break;
function manual_config(App $a) {
$data = htmlentities($a->data['txt'],ENT_COMPAT, 'UTF-8');
- $o = L10n::t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
+ $o = L10n::t('The database configuration file "config/local.ini.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
return $o;
}