X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FConsole%2FMaintenance.php;h=0cb0da9c60e01596a4f457e72d443d599746d08e;hb=c713c2bf622257dbecf223b5f58bf8a98dde9d65;hp=cf0a468ff6fcf1b196ef80527cf664d2f8e369d7;hpb=641bd5eaa6f4ff2f7c975d87d60dd7bba8829eba;p=friendica.git diff --git a/src/Core/Console/Maintenance.php b/src/Core/Console/Maintenance.php index cf0a468ff6..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,6 +44,8 @@ HELP; protected function doExecute() { + $a = \Friendica\BaseObject::getApp(); + if ($this->getOption('v')) { $this->out('Class: ' . __CLASS__); $this->out('Arguments: ' . var_export($this->args, true)); @@ -62,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);