diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-09-30 17:45:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 17:45:22 +0200 |
commit | 59174cfa7c87a515306094239355171873f81ecf (patch) | |
tree | 5325023c32bbc7d7c164557aa860e69a27c88437 | |
parent | eea3d7d47d9753937058428e3c627cef193ee8a6 (diff) | |
parent | 3b6be677191f3ee34b86b4c06c3c13931edc099f (diff) | |
download | nextcloud-server-59174cfa7c87a515306094239355171873f81ecf.tar.gz nextcloud-server-59174cfa7c87a515306094239355171873f81ecf.zip |
Merge pull request #28492 from nextcloud/bugfix/occ-status
Align occ status with status.php
-rw-r--r-- | core/Command/Status.php | 28 | ||||
-rw-r--r-- | core/register_command.php | 2 |
2 files changed, 25 insertions, 5 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); diff --git a/core/register_command.php b/core/register_command.php index 526707b004d..c110a0a3155 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -51,7 +51,7 @@ declare(strict_types=1); use Psr\Log\LoggerInterface; $application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand()); -$application->add(new OC\Core\Command\Status); +$application->add(new OC\Core\Command\Status(\OC::$server->get(\OCP\IConfig::class), \OC::$server->get(\OCP\Defaults::class))); $application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig())); $application->add(new OC\Core\Command\App\CheckCode()); $application->add(new OC\Core\Command\L10n\CreateJs()); |