summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-25 12:51:16 +0100
committerVincent Petry <pvince81@owncloud.com>2014-06-12 17:38:26 +0200
commit6fcd1af4db2d1bf8d61fa0c627c308e7257294b9 (patch)
tree3ec301f0ed7ca4697673d3de9cbfc7719b4e32d2 /core
parentab7cff6dfd63213746a29f4c0557e92a84561498 (diff)
downloadnextcloud-server-6fcd1af4db2d1bf8d61fa0c627c308e7257294b9.tar.gz
nextcloud-server-6fcd1af4db2d1bf8d61fa0c627c308e7257294b9.zip
Add support for repair step classes
This also makes it possible to unit test each repair step class individually
Diffstat (limited to 'core')
-rw-r--r--core/command/maintenance/repair.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/command/maintenance/repair.php b/core/command/maintenance/repair.php
index 310c01fbe2a..43ae6479eb0 100644
--- a/core/command/maintenance/repair.php
+++ b/core/command/maintenance/repair.php
@@ -33,9 +33,22 @@ class Repair extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
+ \OC_DB::enableCaching(false);
+ $maintenanceMode = \OC_Config::getValue('maintenance', false);
+ \OC_Config::setValue('maintenance', true);
+
$this->repair->listen('\OC\Repair', 'step', function ($description) use ($output) {
$output->writeln(' - ' . $description);
});
+ $this->repair->listen('\OC\Repair', 'info', function ($description) use ($output) {
+ $output->writeln(' - ' . $description);
+ });
+ $this->repair->listen('\OC\Repair', 'error', function ($description) use ($output) {
+ $output->writeln(' - ERROR: ' . $description);
+ });
+
$this->repair->run();
+
+ \OC_Config::setValue('maintenance', $maintenanceMode);
}
}