Status.php 981 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\Core\Command\Encryption;
  8. use OC\Core\Command\Base;
  9. use OCP\Encryption\IManager;
  10. use Symfony\Component\Console\Input\InputInterface;
  11. use Symfony\Component\Console\Output\OutputInterface;
  12. class Status extends Base {
  13. public function __construct(
  14. protected IManager $encryptionManager,
  15. ) {
  16. parent::__construct();
  17. }
  18. protected function configure() {
  19. parent::configure();
  20. $this
  21. ->setName('encryption:status')
  22. ->setDescription('Lists the current status of encryption')
  23. ;
  24. }
  25. protected function execute(InputInterface $input, OutputInterface $output): int {
  26. $this->writeArrayInOutputFormat($input, $output, [
  27. 'enabled' => $this->encryptionManager->isEnabled(),
  28. 'defaultModule' => $this->encryptionManager->getDefaultEncryptionModuleId(),
  29. ]);
  30. return 0;
  31. }
  32. }