/** * @param \Lightwerk\SurfCaptain\Domain\Facet\Deployment\SyncDeployment $syncDeployment * @return void */ public function createAction(SyncDeployment $syncDeployment) { try { $deployment = $this->deploymentFactory->createFromSyncDeployment($syncDeployment); $this->deploymentRepository->add($deployment); $this->addFlashMessage('Created a new sync deployment.', 'OK', Message::SEVERITY_OK); $this->redirect('index', 'Deployment', NULL, array('deployment' => $deployment)); } catch (\Lightwerk\SurfCaptain\Exception $e) { $this->handleException($e); } catch (\TYPO3\Flow\Http\Exception $e) { $this->handleException($e); } $this->redirect('index', 'Deployment'); }
/** * @param string $presetKey * @param string $type * @return void */ public function createSyncDeploymentCommand($sourcePresetKey, $targetPresetKey, $type = 'TYPO3\\CMS\\Sync') { $syncDeployment = new SyncDeployment(); $syncDeployment->setSourcePresetKey($sourcePresetKey); $syncDeployment->setPresetKey($targetPresetKey); try { $deployment = $this->deploymentFactory->createFromSyncDeployment($syncDeployment); $this->deploymentRepository->add($deployment); $this->outputLine('OK: deployment added'); } catch (\Lightwerk\SurfCaptain\Exception $e) { $this->outputLine('ERROR: ' . $e->getMessage() . ' - ' . $e->getCode()); } catch (\TYPO3\Flow\Http\Exception $e) { $this->outputLine('ERROR: ' . $e->getMessage() . ' - ' . $e->getCode()); } }