Add Install Mode

- Added $install_mode in Class App instead
- Extracted the install business logic to a new Class Install
- Replaced all $a->module == 'install' with $a->install_mode
This commit is contained in:
Philipp Holzer 2018-04-23 22:56:59 +02:00
parent ebe203336f
commit 6973aaefc2
5 changed files with 349 additions and 306 deletions

View file

@ -5,9 +5,9 @@ namespace Friendica\Core\Console;
use Asika\SimpleConsole\Console;
use dba;
use Friendica\App;
use Friendica\Core\Install;
require_once 'mod/install.php';
require_once 'include/dba.php';
class AutomaticInstallation extends Console
{
@ -43,6 +43,8 @@ HELP;
$db_data = '';
require_once 'htconfig.php';
Install::setInstallMode();
$this->out(" Complete!\n\n");
// Check basic setup
@ -74,7 +76,7 @@ HELP;
// Install database
$this->out("Inserting data into database...\n");
$checkResults['data'] = load_database();
$checkResults['data'] = Install::loadDatabase();
if ($checkResults['data'] !== '') {
throw new \RuntimeException("ERROR: DB Database creation error. Is the DB empty?\n");
@ -101,14 +103,14 @@ HELP;
{
$checks = [];
check_funcs($checks);
check_imagik($checks);
check_htconfig($checks);
check_smarty3($checks);
check_keys($checks);
Install::checkFunctions($checks);
Install::checkImagik($checks);
Install::checkHtConfig($checks);
Install::checkSmarty3($checks);
Install::checkKeys($checks);
if (!empty($app->config['php_path'])) {
check_php($app->config['php_path'], $checks);
Install::checkPHP($app->config['php_path'], $checks);
} else {
throw new \RuntimeException(" ERROR: The php_path is not set in the config. Please check the file .htconfig.php.\n");
}