/** * {@inheritdoc} */ public function execute() { $this->maintenanceMode->set(true); $this->backup->execute(); try { $this->status->add('Starting composer update...'); foreach ($this->params as $directive => $params) { $this->composerManager->updateComposerConfigFile($directive, $params); } $this->composerManager->runUpdate(); $this->status->setUpdateError(false); $this->maintenanceMode->set(false); $this->status->add('Composer update completed successfully'); } catch (\Exception $e) { $this->status->setUpdateError(true); try { $this->rollback->execute(); $this->status->setUpdateError(false); $this->maintenanceMode->set(false); } catch (\Exception $e) { throw new \RuntimeException(sprintf('Could not complete %s successfully: %s', $this, $e->getMessage())); } throw new \RuntimeException(sprintf('Could not complete %s successfully: %s', $this, $e->getMessage())); } $this->flushMagentoCache(); return $this; }