]> 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 0f08b0fd8bbe448727e5e6273481aecca63648d3..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;
 
@@ -52,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;
                        }
 
@@ -70,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);
 
@@ -111,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');
@@ -161,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, [
@@ -185,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(),
@@ -194,7 +192,6 @@ function install_content(App $a) {
                                '$phpath' => $phpath,
 
                                '$submit' => L10n::t('Submit'),
-
                        ]);
                        return $o;
                }; break;