]> git.mxchange.org Git - friendica.git/blobdiff - mod/install.php
Make frio more consistent by replacing textual links with icons everywhere. (#5415)
[friendica.git] / mod / install.php
index 6962ff2ddaf531ff87cb382ffc88ea01e03cd908..d55ee6ea8bbbc644f1ac1750e8d304251faab1c9 100644 (file)
@@ -4,9 +4,10 @@
  */
 
 use Friendica\App;
-use Friendica\Core\L10n;
 use Friendica\Core\Install;
+use Friendica\Core\L10n;
 use Friendica\Core\System;
+use Friendica\Database\DBA;
 use Friendica\Database\DBM;
 use Friendica\Util\Temporal;
 
@@ -22,7 +23,8 @@ function install_init(App $a) {
 
        // 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();
@@ -51,7 +53,7 @@ function install_post(App $a) {
                        $phpath = notags(trim($_POST['phpath']));
 
                        require_once("include/dba.php");
-                       if (!dba::connect($dbhost, $dbuser, $dbpass, $dbdata)) {
+                       if (!DBA::connect($dbhost, $dbuser, $dbpass, $dbdata)) {
                                $a->data['db_conn_failed'] = true;
                        }
 
@@ -69,7 +71,7 @@ function install_post(App $a) {
                        $adminmail = notags(trim($_POST['adminmail']));
 
                        // connect to db
-                       dba::connect($dbhost, $dbuser, $dbpass, $dbdata);
+                       DBA::connect($dbhost, $dbuser, $dbpass, $dbdata);
 
                        Install::install($urlpath, $dbhost, $dbuser, $dbpass, $dbdata, $phpath, $timezone, $language, $adminmail);
 
@@ -110,7 +112,7 @@ function install_content(App $a) {
                $db_return_text .= $txt;
        }
 
-       if (dba::$connected) {
+       if (DBA::$connected) {
                $r = q("SELECT COUNT(*) as `total` FROM `user`");
                if (DBM::is_result($r) && $r[0]['total']) {
                        $tpl = get_markup_template('install.tpl');
@@ -160,13 +162,12 @@ function install_content(App $a) {
 
                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, [
@@ -184,8 +185,6 @@ function install_content(App $a) {
                                '$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(),
@@ -193,7 +192,6 @@ function install_content(App $a) {
                                '$phpath' => $phpath,
 
                                '$submit' => L10n::t('Submit'),
-
                        ]);
                        return $o;
                }; break;