<?php
-
+/**
+ * @file mod/install.php
+ */
use Friendica\App;
-
-require_once "include/Photo.php";
+use Friendica\Core\System;
+use Friendica\Database\DBM;
+use Friendica\Database\DBStructure;
+use Friendica\Object\Image;
$install_wizard_pass = 1;
// 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->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')) {
}
function install_post(App $a) {
- global $install_wizard_pass, $db;
+ global $install_wizard_pass;
switch($install_wizard_pass) {
case 1:
$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;
}
$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(
$a->data['txt'] = $txt;
}
- $errors = load_database($db);
+ $errors = load_database();
if ($errors) {
function install_content(App $a) {
- global $install_wizard_pass, $db;
+ global $install_wizard_pass;
$o = '';
$wizard_status = "";
$install_title = t('Friendica Communications Server - Setup');
$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,
'$next' => t('Next'),
'$reload' => t('Check again'),
'$phpath' => $phpath,
- '$baseurl' => App::get_baseurl(),
+ '$baseurl' => System::baseUrl(),
));
return $o;
}; break;
'$lbl_10' => t('Please select a default timezone for your website'),
- '$baseurl' => App::get_baseurl(),
+ '$baseurl' => System::baseUrl(),
'$phpath' => $phpath,
'$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(),
$help = "";
if (!$passed) {
$help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL;
- $help .= t("If you don't have a command line version of PHP installed on server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-poller'>'Setup the poller'</a>") . EOL;
+ $help .= t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
$help .= EOL . EOL;
$tpl = get_markup_template('field_input.tpl');
$help .= replace_macros($tpl, array(
$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") {
if (class_exists('Imagick')) {
$imagick = true;
- $supported = Photo::supportedTypes();
+ $supported = Image::supportedTypes();
if (array_key_exists('image/gif', $supported)) {
$gif = true;
}
}
}
-function load_database($db) {
-
- require_once("include/dbstructure.php");
- $errors = update_structure(false, true);
+function load_database() {
+ $errors = DBStructure::update(false, true);
return $errors;
}
function what_next() {
- $baseurl = App::get_baseurl();
+ $baseurl = System::baseUrl();
return
t('<h1>What next</h1>')
- ."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.')
+ ."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
.t('Please see the file "INSTALL.txt".')
."</p><p>"
.t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")