/** * Forwards the request to another command and / or CommandController. * * Request is directly transferred to the other command / controller * without the need for a new request. * * @param string $commandName * @param string $controllerObjectName * @param array $arguments * @return void * @throws StopActionException */ protected function forward($commandName, $controllerObjectName = null, array $arguments = []) { $this->request->setDispatched(false); $this->request->setControllerCommandName($commandName); if ($controllerObjectName !== null) { $this->request->setControllerObjectName($controllerObjectName); } $this->request->setArguments($arguments); $this->arguments->removeAll(); throw new StopActionException('forward', 1476107661); }
/** * Forwards the request to another command and / or CommandController. * * Request is directly transferred to the other command / controller * without the need for a new request. * * @param string $commandName * @param string $controllerObjectName * @param array $arguments * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException * @return void */ protected function forward($commandName, $controllerObjectName = NULL, array $arguments = array()) { $this->request->setDispatched(FALSE); $this->request->setControllerCommandName($commandName); if ($controllerObjectName !== NULL) { $this->request->setControllerObjectName($controllerObjectName); } $this->request->setArguments($arguments); $this->arguments->removeAll(); throw new \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException(); }
/** * Execute Task * * If errors occur during Task execution they are thrown as Exceptions which * must be caught manually if you manually execute Tasks through your code. * * @param \TYPO3\CMS\Extbase\Scheduler\Task $task the task to execute * @return void */ public function execute(\TYPO3\CMS\Extbase\Scheduler\Task $task) { $commandIdentifier = $task->getCommandIdentifier(); list($extensionKey, $controllerName, $commandName) = explode(':', $commandIdentifier); $extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($extensionKey); $this->initialize(array('extensionName' => $extensionName)); // execute command $command = $this->commandManager->getCommandByIdentifier($commandIdentifier); $this->request->setControllerObjectName($command->getControllerClassName()); $this->request->setControllerCommandName($command->getControllerCommandName()); $this->request->setArguments($task->getArguments()); $this->dispatcher->dispatch($this->request, $this->response); $this->shutdown(); }