X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConsole%2FMaintenance.php;h=0cb0da9c60e01596a4f457e72d443d599746d08e;hb=c713c2bf622257dbecf223b5f58bf8a98dde9d65;hp=6638e4bfe168c477a2f5349d3506af7825091b6c;hpb=5e5fde0a63c57d2873bfa29404110269ca9abeee;p=friendica.git diff --git a/src/Core/Console/Maintenance.php b/src/Core/Console/Maintenance.php index 6638e4bfe1..0cb0da9c60 100644 --- a/src/Core/Console/Maintenance.php +++ b/src/Core/Console/Maintenance.php @@ -4,13 +4,10 @@ namespace Friendica\Core\Console; use Friendica\Core; -require_once 'boot.php'; -require_once 'include/dba.php'; - /** * @brief Sets maintenance mode for this node * - * @author Hypolite Petovan + * @author Hypolite Petovan */ class Maintenance extends \Asika\SimpleConsole\Console { @@ -47,7 +44,7 @@ HELP; protected function doExecute() { - $a = get_app(); + $a = \Friendica\BaseObject::getApp(); if ($this->getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -64,19 +61,10 @@ HELP; throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments'); } - require_once '.htconfig.php'; - $result = \dba::connect($db_host, $db_user, $db_pass, $db_data); - unset($db_host, $db_user, $db_pass, $db_data); - - if (!$result) { - throw new \RuntimeException('Unable to connect to database'); + if ($a->getMode()->isInstall()) { + throw new \RuntimeException('Database isn\'t ready or populated yet'); } - Core\Config::load(); - - $lang = Core\L10n::getBrowserLanguage(); - Core\L10n::loadTranslationTable($lang); - $enabled = intval($this->getArgument(0)); Core\Config::set('system', 'maintenance', $enabled);