mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #28492 from nextcloud/bugfix/occ-status
Align occ status with status.php
This commit is contained in:
commit
59174cfa7c
2 changed files with 25 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue