repair.php 983 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\Core\Command\Maintenance;
  9. use Symfony\Component\Console\Command\Command;
  10. use Symfony\Component\Console\Input\InputInterface;
  11. use Symfony\Component\Console\Output\OutputInterface;
  12. class Repair extends Command {
  13. /**
  14. * @var \OC\Repair $repair
  15. */
  16. protected $repair;
  17. /**
  18. * @param \OC\Repair $repair
  19. */
  20. public function __construct($repair) {
  21. $this->repair = $repair;
  22. parent::__construct();
  23. }
  24. protected function configure() {
  25. $this
  26. ->setName('maintenance:repair')
  27. ->setDescription('set single user mode');
  28. }
  29. protected function execute(InputInterface $input, OutputInterface $output) {
  30. $this->repair->listen('\OC\Repair', 'step', function ($description) use ($output) {
  31. $output->writeln(' - ' . $description);
  32. });
  33. $this->repair->run();
  34. }
  35. }