/** * Handles the request * * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface */ public function handleRequest() { $this->boot(isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : ''); $commandLine = isset($_SERVER['argv']) ? $_SERVER['argv'] : array(); $callingScript = array_shift($commandLine); if ($callingScript !== $_SERVER['_']) { $callingScript = $_SERVER['_'] . ' ' . $callingScript; } $this->request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\RequestBuilder')->build($commandLine, $callingScript); $this->response = new \TYPO3\CMS\Extbase\Mvc\Cli\Response(); $this->dispatcher->dispatch($this->request, $this->response); $this->response->send(); $this->shutdown(); }
/** * Sends the response and exits the CLI without any further code execution * Should be used for commands that flush code caches. * * @param integer $exitCode Exit code to return on exit * @return void */ protected function sendAndExit($exitCode = 0) { $this->response->send(); die($exitCode); }