1
0

CleanUpAbandonedApps.php 854 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Repair;
  8. use OCP\IConfig;
  9. use OCP\Migration\IOutput;
  10. use OCP\Migration\IRepairStep;
  11. class CleanUpAbandonedApps implements IRepairStep {
  12. protected const ABANDONED_APPS = ['accessibility', 'files_videoplayer'];
  13. private IConfig $config;
  14. public function __construct(IConfig $config) {
  15. $this->config = $config;
  16. }
  17. public function getName(): string {
  18. return 'Clean up abandoned apps';
  19. }
  20. public function run(IOutput $output): void {
  21. foreach (self::ABANDONED_APPS as $app) {
  22. // only remove global app values
  23. // user prefs of accessibility are dealt with in Theming migration
  24. // videoplayer did not have user prefs
  25. $this->config->deleteAppValues($app);
  26. }
  27. }
  28. }