summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-09-09 10:20:36 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-09-09 10:20:36 -0100
commitc6a7ffe6d3fbeb926aaa5dd3a07e008789f9bfe9 (patch)
treeac5e1fefdd95425b79e41bebd75dd1baeb72caeb
parent51ac5573dd6056500d3f85e6bcdcca27b5e651d7 (diff)
display details on the current installation during social:check:install
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/Command/CheckInstall.php12
-rw-r--r--lib/Service/ConfigService.php21
2 files changed, 27 insertions, 6 deletions
diff --git a/lib/Command/CheckInstall.php b/lib/Command/CheckInstall.php
index 7fecbfc0..17be71a8 100644
--- a/lib/Command/CheckInstall.php
+++ b/lib/Command/CheckInstall.php
@@ -35,6 +35,7 @@ use daita\MySmallPhpTools\Traits\TArrayTools;
use Exception;
use OC\Core\Command\Base;
use OCA\Social\Service\CheckService;
+use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
use OCA\Social\Service\PushService;
use OCP\IUserManager;
@@ -55,6 +56,9 @@ class CheckInstall extends Base {
/** @var CheckService */
private $checkService;
+ /** @var */
+ private $configService;
+
/** @var MiscService */
private $miscService;
@@ -64,17 +68,19 @@ class CheckInstall extends Base {
*
* @param IUserManager $userManager
* @param CheckService $checkService
+ * @param ConfigService $configService
* @param MiscService $miscService
* @param PushService $pushService
*/
public function __construct(
- IUserManager $userManager, CheckService $checkService, MiscService $miscService,
- PushService $pushService
+ IUserManager $userManager, CheckService $checkService, ConfigService $configService,
+ MiscService $miscService, PushService $pushService
) {
parent::__construct();
$this->userManager = $userManager;
$this->checkService = $checkService;
+ $this->configService = $configService;
$this->miscService = $miscService;
$this->pushService = $pushService;
}
@@ -112,6 +118,8 @@ class CheckInstall extends Base {
$output->writeln('- ' . $this->getInt('invalidFollowers', $result, 0) . ' invalid followers removed');
$output->writeln('- ' . $this->getInt('invalidNotes', $result, 0) . ' invalid notes removed');
+
+ $output->writeln(json_encode($this->configService->getConfig(), JSON_PRETTY_PRINT));
}
diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php
index fb5b1fe0..715ff8f5 100644
--- a/lib/Service/ConfigService.php
+++ b/lib/Service/ConfigService.php
@@ -56,9 +56,6 @@ class ConfigService {
const SOCIAL_URL = 'social_url';
const SOCIAL_ADDRESS = 'social_address';
- // deprecated -> CLOUD_URL
- const CLOUD_ADDRESS = 'address';
-
const SOCIAL_SERVICE = 'service';
const SOCIAL_MAX_SIZE = 'max_size';
const SOCIAL_ACCESS_TYPE = 'access_type';
@@ -74,7 +71,6 @@ class ConfigService {
self::CLOUD_URL => '',
self::SOCIAL_URL => '',
self::SOCIAL_ADDRESS => '',
- self::CLOUD_ADDRESS => '',
self::SOCIAL_SERVICE => 1,
self::SOCIAL_MAX_SIZE => 10,
self::SOCIAL_ACCESS_TYPE => 'all_but',
@@ -126,6 +122,22 @@ class ConfigService {
/**
+ * @return array
+ */
+ public function getConfig(): array {
+ $keys = array_keys($this->defaults);
+ $data = [];
+
+ foreach ($keys as $k) {
+ $data[$k] = $this->getAppValue($k);
+ }
+
+ return $data;
+ }
+
+
+ /**
+ * /**
* Get a value by key
*
* @param string $key
@@ -407,5 +419,6 @@ class ConfigService {
return $id;
}
+
}