public function handleRequest()
{
$runLevel = $this->bootstrap->isCompiletimeCommand(isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '') ? Bootstrap::RUNLEVEL_COMPILETIME : Bootstrap::RUNLEVEL_RUNTIME;
$this->boot($runLevel);
$commandLine = isset($_SERVER['argv']) ? $_SERVER['argv'] : [];
$this->request = $this->objectManager->get(RequestBuilder::class)->build(array_slice($commandLine, 1));
$this->response = new Response();
$this->exitIfCompiletimeCommandWasNotCalledCorrectly($runLevel);
if ($runLevel === Bootstrap::RUNLEVEL_RUNTIME) {
/** @var Context $securityContext */
$securityContext = $this->objectManager->get(Context::class);
$securityContext->withoutAuthorizationChecks(function () {
$this->dispatcher->dispatch($this->request, $this->response);
});
} else {
$this->dispatcher->dispatch($this->request, $this->response);
}
$this->response->send();
$this->shutdown($runLevel);
}