示例#1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->repair->listen('\\OC\\Repair', 'step', function ($description) use($output) {
         $output->writeln(' - ' . $description);
     });
     $this->repair->run();
 }
示例#2
0
文件: repair.php 项目: kenwi/core
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $includeExpensive = $input->getOption('include-expensive');
     if ($includeExpensive) {
         foreach ($this->repair->getExpensiveRepairSteps() as $step) {
             $this->repair->addStep($step);
         }
     }
     $maintenanceMode = $this->config->getSystemValue('maintenance', false);
     $this->config->setSystemValue('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', 'warning', function ($description) use($output) {
         $output->writeln('     - WARNING: ' . $description);
     });
     $this->repair->listen('\\OC\\Repair', 'error', function ($description) use($output) {
         $output->writeln('     - ERROR: ' . $description);
     });
     $this->repair->run();
     $this->config->setSystemValue('maintenance', $maintenanceMode);
 }
示例#3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $maintenanceMode = $this->config->getSystemValue('maintenance', false);
     $this->config->setSystemValue('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();
     $this->config->setSystemValue('maintenance', $maintenanceMode);
 }
示例#4
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     // TODO: inject DB connection/factory when possible
     $connection = \OC_DB::getConnection();
     $connection->disableQueryStatementCaching();
     $maintenanceMode = $this->config->getValue('maintenance', false);
     $this->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();
     $this->config->setValue('maintenance', $maintenanceMode);
 }
示例#5
0
	/**
	 * Forward messages emitted by the repair routine
	 *
	 * @param Repair $repair repair routine
	 */
	private function emitRepairMessages(Repair $repair) {
		$repair->listen('\OC\Repair', 'warning', function ($description) {
			$this->emit('\OC\Updater', 'repairWarning', array($description));
		});
		$repair->listen('\OC\Repair', 'error', function ($description) {
			$this->emit('\OC\Updater', 'repairError', array($description));
		});
		$repair->listen('\OC\Repair', 'info', function ($description) {
			$this->emit('\OC\Updater', 'repairInfo', array($description));
		});
		$repair->listen('\OC\Repair', 'step', function ($description) {
			$this->emit('\OC\Updater', 'repairStep', array($description));
		});
	}