Skip to content

Commit e695f76

Browse files
committed
Display the current configuration with the occ "status" command if --verbose.
Signed-off-by: Claus-Justus Heine <[email protected]>
1 parent dd13f30 commit e695f76

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

lib/Command/Status.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
3131
$isConfigured = $gateway->isComplete();
3232
$settings = $gateway->getSettings();
3333
$output->writeln($settings['name'] . ': ' . ($isConfigured ? 'configured' : 'not configured'));
34+
$output->write(print_r($gateway->getConfiguration(), true), true, OutputInterface::VERBOSITY_VERBOSE);
3435
}
3536
return 0;
3637
}

lib/Provider/Gateway/AGateway.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ public function isComplete(array $schema = []): bool {
4242
return count($intersect) === count($fields);
4343
}
4444

45+
#[\Override]
46+
public function getConfiguration(array $schema = []): array {
47+
if (empty($schema)) {
48+
$schema = static::SCHEMA;
49+
}
50+
$providerId = $this->getProviderId();
51+
$config = [];
52+
foreach ($schema['fields'] as $f) {
53+
$config[$f['field']] = $this->appConfig->getValueString(
54+
Application::APP_ID,
55+
$providerId . '_' . $f['field'],
56+
$f['default'] ?? '',
57+
);
58+
}
59+
return $config;
60+
}
61+
4562
#[\Override]
4663
public function getSettings(): array {
4764
$settings = [];

lib/Provider/Gateway/IGateway.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public function isComplete(array $schema = []): bool;
2929

3030
public function getSettings(): array;
3131

32+
public function getConfiguration(): array;
33+
3234
public function cliConfigure(InputInterface $input, OutputInterface $output): int;
3335

3436
public function remove(array $schema = []): void;

0 commit comments

Comments
 (0)