1
0

ShippedDashboardEnable.php 793 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Repair\NC20;
  8. use OCP\IConfig;
  9. use OCP\Migration\IOutput;
  10. use OCP\Migration\IRepairStep;
  11. class ShippedDashboardEnable implements IRepairStep {
  12. /** @var IConfig */
  13. private $config;
  14. public function __construct(IConfig $config) {
  15. $this->config = $config;
  16. }
  17. public function getName() {
  18. return 'Remove old dashboard app config data';
  19. }
  20. public function run(IOutput $output) {
  21. $version = $this->config->getAppValue('dashboard', 'version', '7.0.0');
  22. if (version_compare($version, '7.0.0', '<')) {
  23. $this->config->deleteAppValues('dashboard');
  24. $output->info('Removed old dashboard app config');
  25. }
  26. }
  27. }