Exemple #1
0
 /**
  * @param string $appId
  * @param string[] $steps
  * @throws \OC\NeedsUpdateException
  */
 public static function executeRepairSteps($appId, array $steps)
 {
     if (empty($steps)) {
         return;
     }
     // load the app
     self::loadApp($appId, false);
     $dispatcher = OC::$server->getEventDispatcher();
     // load the steps
     $r = new Repair([], $dispatcher);
     foreach ($steps as $step) {
         try {
             $r->addStep($step);
         } catch (Exception $ex) {
             $r->emit('\\OC\\Repair', 'error', [$ex->getMessage()]);
             \OC::$server->getLogger()->logException($ex);
         }
     }
     // run the steps
     $r->run();
 }