mirror of
https://github.com/friendica/friendica
synced 2025-04-27 04:30:11 +00:00
Remove deprecated Mode::DBCONFIGAVAILABLE
This commit is contained in:
parent
1e574d5383
commit
10f3de0aa2
6 changed files with 5 additions and 55 deletions
|
@ -149,16 +149,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($configCache->get('system', 'maintenance'))) {
|
||||
return new Mode($mode);
|
||||
}
|
||||
|
||||
|
@ -232,14 +223,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -251,7 +242,6 @@ class Mode
|
|||
{
|
||||
return $this->has(Mode::LOCALCONFIGPRESENT) &&
|
||||
$this->has(Mode::DBAVAILABLE) &&
|
||||
$this->has(Mode::DBCONFIGAVAILABLE) &&
|
||||
$this->has(Mode::MAINTENANCEDISABLED);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ HELP;
|
|||
$this->out('Options: ' . var_export($this->options, true));
|
||||
}
|
||||
|
||||
if (!$this->appMode->has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) {
|
||||
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
|
||||
}
|
||||
|
||||
|
|
|
@ -115,10 +115,6 @@ HELP;
|
|||
throw new CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
if (!$this->appMode->has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
$this->out('Database isn\'t ready or populated yet, showing file config only');
|
||||
}
|
||||
|
||||
if (count($this->args) == 3) {
|
||||
$cat = $this->getArgument(0);
|
||||
$key = $this->getArgument(1);
|
||||
|
@ -180,10 +176,6 @@ HELP;
|
|||
if (count($this->args) == 0) {
|
||||
$this->config->reload();
|
||||
|
||||
if ($this->config->get('system', 'config_adapter') == 'jit' && $this->appMode->has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
$this->out('Warning: The JIT (Just In Time) Config adapter doesn\'t support loading the entire configuration, showing file config only');
|
||||
}
|
||||
|
||||
$config = $this->config->getCache()->getAll();
|
||||
foreach ($config as $cat => $section) {
|
||||
if (is_array($section)) {
|
||||
|
|
|
@ -93,7 +93,7 @@ HELP;
|
|||
$this->out('Options: ' . var_export($this->options, true));
|
||||
}
|
||||
|
||||
if (!$this->appMode->has(App\Mode::DBCONFIGAVAILABLE)) {
|
||||
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) {
|
||||
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue