X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp%2FMode.php;h=7cd16b4bb905e8866af2e28675edd3c77bfaf309;hb=da58b894a4239e95342524eeacb85af7bf6c5a9d;hp=5d6bd759f27197f2bd1410cc2b3f7e8fb2ecd36d;hpb=8db0e090d7afc3fbfeaf7a587140c80c98233484;p=friendica.git diff --git a/src/App/Mode.php b/src/App/Mode.php index 5d6bd759f2..7cd16b4bb9 100644 --- a/src/App/Mode.php +++ b/src/App/Mode.php @@ -1,6 +1,6 @@ getPath(); - - if (!file_exists($basepathName . '/config/local.config.php') - && !file_exists($basepathName . '/config/local.ini.php') - && !file_exists($basepathName . '/.htconfig.php')) { + if (!file_exists($basePath . '/config/local.config.php') && + !file_exists($basePath . '/config/local.ini.php') && + !file_exists($basePath . '/.htconfig.php')) { return new Mode($mode); } @@ -150,16 +146,7 @@ class Mode $mode |= Mode::DBAVAILABLE; - if ($database->fetchFirst("SHOW TABLES LIKE 'config'") === false) { - return new Mode($mode); - } - - $mode |= Mode::DBCONFIGAVAILABLE; - - if (!empty($configCache->get('system', 'maintenance')) || - // Don't use Config or Configuration here because we're possibly BEFORE initializing the Configuration, - // so this could lead to a dependency circle - !empty($database->selectFirst('config', ['v'], ['cat' => 'system', 'k' => 'maintenance'])['v'])) { + if (!empty($config->get('system', 'maintenance'))) { return new Mode($mode); } @@ -233,14 +220,14 @@ class Mode } /** - * Install mode is when the local config file is missing or the DB schema hasn't been installed yet. + * Install mode is when the local config file is missing or the database isn't available. * * @return bool Whether installation mode is active (local/database configuration files present or not) */ public function isInstall(): bool { return !$this->has(Mode::LOCALCONFIGPRESENT) || - !$this->has(MODE::DBCONFIGAVAILABLE); + !$this->has(MODE::DBAVAILABLE); } /** @@ -252,7 +239,6 @@ class Mode { return $this->has(Mode::LOCALCONFIGPRESENT) && $this->has(Mode::DBAVAILABLE) && - $this->has(Mode::DBCONFIGAVAILABLE) && $this->has(Mode::MAINTENANCEDISABLED); }