1
0

Status.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. namespace OC\Core\Command;
  26. use OC_Util;
  27. use OCP\Defaults;
  28. use OCP\IConfig;
  29. use OCP\Util;
  30. use Symfony\Component\Console\Input\InputInterface;
  31. use Symfony\Component\Console\Output\OutputInterface;
  32. class Status extends Base {
  33. private IConfig $config;
  34. private Defaults $themingDefaults;
  35. public function __construct(IConfig $config, Defaults $themingDefaults) {
  36. parent::__construct('status');
  37. $this->config = $config;
  38. $this->themingDefaults = $themingDefaults;
  39. }
  40. protected function configure() {
  41. parent::configure();
  42. $this
  43. ->setDescription('show some status information')
  44. ;
  45. }
  46. protected function execute(InputInterface $input, OutputInterface $output): int {
  47. $values = [
  48. 'installed' => $this->config->getSystemValueBool('installed', false),
  49. 'version' => implode('.', Util::getVersion()),
  50. 'versionstring' => OC_Util::getVersionString(),
  51. 'edition' => '',
  52. 'maintenance' => $this->config->getSystemValueBool('maintenance', false),
  53. 'needsDbUpgrade' => Util::needUpgrade(),
  54. 'productname' => $this->themingDefaults->getProductName(),
  55. 'extendedSupport' => Util::hasExtendedSupport()
  56. ];
  57. $this->writeArrayInOutputFormat($input, $output, $values);
  58. return 0;
  59. }
  60. }