display details on the current installation during social:check:install

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/728/head
Maxence Lange 2019-09-09 10:20:36 -01:00
rodzic 51ac5573dd
commit c6a7ffe6d3
2 zmienionych plików z 27 dodań i 6 usunięć

Wyświetl plik

@ -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));
}

Wyświetl plik

@ -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;
}
}