added quiet option

This commit is contained in:
tracer 2022-09-21 16:00:16 +02:00
parent 9474a9ebef
commit f81b0451b4
1 changed files with 6 additions and 1 deletions

View File

@ -9,7 +9,7 @@ class ConfigController
{ {
private array $config; private array $config;
public function __construct(bool $verbose = false) { public function __construct(bool $verbose = false, bool $quiet = false) {
$configFile = dirname(path: __DIR__, levels: 2) . "/config.json.local"; $configFile = dirname(path: __DIR__, levels: 2) . "/config.json.local";
if (!file_exists(filename: $configFile)) { if (!file_exists(filename: $configFile)) {
$configFile = dirname(path: __DIR__, levels: 2) . "/config.json"; $configFile = dirname(path: __DIR__, levels: 2) . "/config.json";
@ -41,6 +41,11 @@ class ConfigController
} else { } else {
$this->config['verbose'] = false; $this->config['verbose'] = false;
} }
if ($quiet) {
$this->config['quiet'] = true;
} else {
$this->config['quiet'] = false;
}
} }
public function getConfig(string $configKey): string { public function getConfig(string $configKey): string {