X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Finstall.php;h=2d0362c9526b11a53b5eb65f1aebcc5dccf8f60d;hb=4ca68c7af05b7b41e1b04936b9080802ca2b7716;hp=d1d2fd07792bdb00cddee716b1fb23d9919b4d79;hpb=50da541860f4274fc9e365fa4b9330b57577fea9;p=friendica.git diff --git a/mod/install.php b/mod/install.php index d1d2fd0779..2d0362c952 100755 --- a/mod/install.php +++ b/mod/install.php @@ -1,8 +1,12 @@ config['system']['theme'] = "../install"; - $a->theme['stylesheet'] = App::get_baseurl()."/view/install/style.css"; + $a->theme['stylesheet'] = System::baseUrl()."/view/install/style.css"; global $install_wizard_pass; if (x($_POST, 'pass')) { @@ -25,7 +29,7 @@ function install_init(App $a) { } function install_post(App $a) { - global $install_wizard_pass, $db; + global $install_wizard_pass; switch($install_wizard_pass) { case 1: @@ -41,9 +45,7 @@ function install_post(App $a) { $phpath = notags(trim($_POST['phpath'])); require_once("include/dba.php"); - unset($db); - $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true); - if (!$db->connected) { + if (!dba::connect($dbhost, $dbuser, $dbpass, $dbdata, true)) { $a->data['db_conn_failed'] = true; } @@ -62,7 +64,7 @@ function install_post(App $a) { $rino = 2; // connect to db - $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true); + dba::connect($dbhost, $dbuser, $dbpass, $dbdata, true); $tpl = get_markup_template('htconfig.tpl'); $txt = replace_macros($tpl,array( @@ -84,7 +86,7 @@ function install_post(App $a) { $a->data['txt'] = $txt; } - $errors = load_database($db); + $errors = load_database(); if ($errors) { @@ -100,7 +102,7 @@ function install_post(App $a) { function install_content(App $a) { - global $install_wizard_pass, $db; + global $install_wizard_pass; $o = ''; $wizard_status = ""; $install_title = t('Friendica Communications Server - Setup'); @@ -130,9 +132,9 @@ function install_content(App $a) { $db_return_text .= $txt; } - if ($db && $db->connected) { + if (dba::$connected) { $r = q("SELECT COUNT(*) as `total` FROM `user`"); - if (dbm::is_result($r) && $r[0]['total']) { + if (DBM::is_result($r) && $r[0]['total']) { $tpl = get_markup_template('install.tpl'); return replace_macros($tpl, array( '$title' => $install_title, @@ -201,7 +203,7 @@ function install_content(App $a) { '$next' => t('Next'), '$reload' => t('Check again'), '$phpath' => $phpath, - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); return $o; }; break; @@ -235,7 +237,7 @@ function install_content(App $a) { '$lbl_10' => t('Please select a default timezone for your website'), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$phpath' => $phpath, @@ -275,7 +277,7 @@ function install_content(App $a) { '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''), '$language' => array('language', t('System Language:'), 'en', t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), @@ -477,10 +479,10 @@ function check_htaccess(&$checks) { $status = true; $help = ""; if (function_exists('curl_init')) { - $test = fetch_url(App::get_baseurl()."/install/testrewrite"); + $test = fetch_url(System::baseUrl()."/install/testrewrite"); if ($test != "ok") { - $test = fetch_url(normalise_link(App::get_baseurl()."/install/testrewrite")); + $test = fetch_url(normalise_link(System::baseUrl()."/install/testrewrite")); } if ($test != "ok") { @@ -531,7 +533,7 @@ function load_database_rem($v, $i) { } } -function load_database($db) { +function load_database() { require_once("include/dbstructure.php"); $errors = update_structure(false, true); @@ -540,7 +542,7 @@ function load_database($db) { } function what_next() { - $baseurl = App::get_baseurl(); + $baseurl = System::baseUrl(); return t('

What next

') ."

".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.')