Replace Config-Cache dependency with Config-Model (no more DB-waiting necessary)

This commit is contained in:
Philipp 2023-01-15 16:12:25 +01:00
parent a6fb683bcd
commit ab6efea9b2
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
18 changed files with 210 additions and 325 deletions

View file

@ -21,7 +21,7 @@
namespace Friendica\Console;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Update;
use Friendica\Database\Database;
use Friendica\Database\DBStructure;
@ -43,8 +43,8 @@ class DatabaseStructure extends \Asika\SimpleConsole\Console
/** @var Database */
private $dba;
/** @var Cache */
private $configCache;
/** @var IManageConfigValues */
private $config;
/** @var DbaDefinition */
private $dbaDefinition;
@ -83,14 +83,14 @@ HELP;
return $help;
}
public function __construct(Database $dba, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition, BasePath $basePath, Cache $configCache, $argv = null)
public function __construct(Database $dba, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition, BasePath $basePath, IManageConfigValues $config, $argv = null)
{
parent::__construct($argv);
$this->dba = $dba;
$this->dbaDefinition = $dbaDefinition;
$this->viewDefinition = $viewDefinition;
$this->configCache = $configCache;
$this->config = $config;
$this->basePath = $basePath->getPath();
}
@ -117,7 +117,7 @@ HELP;
throw new RuntimeException('Unable to connect to database');
}
$basePath = $this->configCache->get('system', 'basepath');
$basePath = $this->config->get('system', 'basepath');
switch ($this->getArgument(0)) {
case "dryrun":