Exemplo n.º 1
0
 /**
  * Execute a task
  *
  * @param string $task
  * @param \TYPO3\Deploy\Domain\Model\Node $node
  * @param \TYPO3\Deploy\Domain\Model\Application $application
  * @param \TYPO3\Deploy\Domain\Model\Deployment $deployment
  * @param array $options
  * @return void
  */
 public function execute($task, \TYPO3\Deploy\Domain\Model\Node $node, \TYPO3\Deploy\Domain\Model\Application $application, \TYPO3\Deploy\Domain\Model\Deployment $deployment, array $options = array())
 {
     list($packageKey, $taskName) = explode(':', $task, 2);
     $taskClassName = strtr($packageKey, '.', '\\') . '\\Task\\' . strtr($taskName, ':', '\\') . 'Task';
     $taskObjectName = $this->objectManager->getCaseSensitiveObjectName($taskClassName);
     if (!$this->objectManager->isRegistered($taskObjectName)) {
         throw new \Exception('Task "' . $task . '" not registered ' . $taskClassName);
     }
     $task = $this->objectManager->create($taskObjectName);
     if (!$deployment->isDryRun()) {
         $task->execute($node, $application, $deployment, $options);
     } else {
         $task->simulate($node, $application, $deployment, $options);
     }
     $this->taskHistory[] = array('task' => $task, 'node' => $node, 'application' => $application, 'deployment' => $deployment, 'options' => $options);
 }
Exemplo n.º 2
0
 public function getActionByShortName($action = null)
 {
     $actions = array();
     foreach ($this->reflectionService->getAllImplementationClassNamesForInterface('Admin\\Core\\Actions\\ActionInterface') as $actionClassName) {
         $actionName = \Admin\Core\Helper::getShortName($actionClassName);
         if (strtolower($actionName) == strtolower($action)) {
             return $this->objectManager->create($actionClassName, $this->getAdapter(), $this->request, $this->view, $this);
         }
     }
     return null;
 }
 /**
  * Build the rendering context
  *
  * @param \TYPO3\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer
  * @return \TYPO3\Fluid\Core\Rendering\RenderingContext
  * @author Sebastian Kurfürst <*****@*****.**>
  */
 protected function buildRenderingContext(\TYPO3\Fluid\Core\ViewHelper\TemplateVariableContainer $variableContainer = NULL)
 {
     if ($variableContainer === NULL) {
         $variableContainer = $this->objectManager->create('TYPO3\\Fluid\\Core\\ViewHelper\\TemplateVariableContainer', $this->variables);
     }
     $renderingContext = $this->objectManager->create('TYPO3\\Fluid\\Core\\Rendering\\RenderingContext');
     $renderingContext->injectTemplateVariableContainer($variableContainer);
     if ($this->controllerContext !== NULL) {
         $renderingContext->setControllerContext($this->controllerContext);
     }
     $viewHelperVariableContainer = $this->objectManager->create('TYPO3\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
     $viewHelperVariableContainer->setView($this->viewHelperVariableContainer->getView());
     $renderingContext->injectViewHelperVariableContainer($viewHelperVariableContainer);
     return $renderingContext;
 }