src/Control/HTTPApplication.php
public function execute(HTTPRequest $request, callable $callback, $flush = false)
    {
        try {
            return $this->callMiddleware($request, function ($request) use ($callback, $flush) {
                // Pre-request boot
                $this->getKernel()->boot($flush);
                return call_user_func($callback, $request);
            });
        } catch (HTTPResponse_Exception $ex) {
            return $ex->getResponse();
        } finally {
            $this->getKernel()->shutdown();
        }
    }
public function execute(HTTPRequest $request, callable $callback, $flush = false)
    {
        try {
            return $this->callMiddleware($request, function ($request) use ($callback, $flush) {
                // Pre-request boot
                $this->getKernel()->boot($flush);
                return call_user_func($callback, $request);
            });
        } catch (HTTPResponse_Exception $ex) {
            return $ex->getResponse();
        } finally {
            $this->getKernel()->shutdown();
        }
    }
public function execute ( HTTPRequest $ request , callable $ callback , $ flush = false ) { try { return $ this -> callMiddleware ( $ request , function ( $ request ) use ( $ callback , $ flush ) { // Pre-request boot $ this -> getKernel ( ) -> boot ( $ flush ) ; return call_user_func ( $ callback , $ request ) ; } ) ; } catch ( HTTPResponse_Exception $ ex ) { return $ ex -> getResponse ( ) ; } finally { $ this -> getKernel ( ) -> shutdown ( ) ; } }
Safely boot the application and execute the given main action

@param HTTPRequest $request
@param callable $callback
@param bool $flush
@return HTTPResponse
Safely boot the application and execute the given main action