diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-08-18 15:27:03 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-08-26 23:36:26 +0300 |
commit | 3b6be677191f3ee34b86b4c06c3c13931edc099f (patch) | |
tree | 347989f69e18e3332ede07774d63703763aa38b1 /core/Command | |
parent | fd93aa816231954ca628daa85bd091fd6ff3a570 (diff) |
Align occ status with status.php
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Status.php | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/core/Command/Status.php b/core/Command/Status.php index 5bcf23dfbca..ad42c253c2c 100644 --- a/core/Command/Status.php +++ b/core/Command/Status.php @@ -24,25 +24,45 @@ */ namespace OC\Core\Command; +use OC_Util; +use OCP\Defaults; +use OCP\IConfig; +use OCP\Util; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class Status extends Base { + + /** @var IConfig */ + private $config; + /** @var Defaults */ + private $themingDefaults; + + public function __construct(IConfig $config, Defaults $themingDefaults) { + parent::__construct('status'); + + $this->config = $config; + $this->themingDefaults = $themingDefaults; + } + protected function configure() { parent::configure(); $this - ->setName('status') ->setDescription('show some status information') ; } protected function execute(InputInterface $input, OutputInterface $output): int { $values = [ - 'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false), - 'version' => implode('.', \OCP\Util::getVersion()), - 'versionstring' => \OC_Util::getVersionString(), + 'installed' => $this->config->getSystemValueBool('installed', false), + 'version' => implode('.', Util::getVersion()), + 'versionstring' => OC_Util::getVersionString(), 'edition' => '', + 'maintenance' => $this->config->getSystemValueBool('maintenance', false), + 'needsDbUpgrade' => Util::needUpgrade(), + 'productname' => $this->themingDefaults->getProductName(), + 'extendedSupport' => Util::hasExtendedSupport() ]; $this->writeArrayInOutputFormat($input, $output, $values); |