Adding Configuration dependency

This commit is contained in:
Philipp Holzer 2019-07-31 19:43:00 +02:00
parent a60eb9e33d
commit 5935e69d33
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
1 changed files with 11 additions and 4 deletions

View File

@ -23,6 +23,12 @@ class AutomaticInstallation extends Console
* @var Config\Cache\ConfigCache * @var Config\Cache\ConfigCache
*/ */
private $configCache; private $configCache;
/**
* @var Config\Configuration
*/
private $config;
/** /**
* @var Database * @var Database
*/ */
@ -83,12 +89,13 @@ Examples
HELP; HELP;
} }
public function __construct(App\Mode $appMode, Config\Cache\ConfigCache $configCache, Database $dba, array $argv = null) public function __construct(App\Mode $appMode, Config\Cache\ConfigCache $configCache, Config\Configuration $config, Database $dba, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
$this->appMode = $appMode; $this->appMode = $appMode;
$this->configCache =$configCache; $this->configCache =$configCache;
$this->config = $config;
$this->dba = $dba; $this->dba = $dba;
} }
@ -181,7 +188,7 @@ HELP;
$this->out('The Friendica URL has to be set during CLI installation.'); $this->out('The Friendica URL has to be set during CLI installation.');
return 1; return 1;
} else { } else {
$baseUrl = new BaseURL($basePathConf, []); $baseUrl = new BaseURL($this->config, []);
$baseUrl->saveByURL($url); $baseUrl->saveByURL($url);
} }
@ -216,8 +223,8 @@ HELP;
// Install theme // Install theme
$this->out("Installing theme\n"); $this->out("Installing theme\n");
if (!empty($configCache->get('system', 'theme'))) { if (!empty($this->config->get('system', 'theme'))) {
Theme::install($configCache->get('system', 'theme')); Theme::install($this->config->get('system', 'theme'));
$this->out(" Complete\n\n"); $this->out(" Complete\n\n");
} else { } else {
$this->out(" Theme setting is empty. Please check the file 'config/local.config.php'\n\n"); $this->out(" Theme setting is empty. Please check the file 'config/local.config.php'\n\n");