src/Loops/Application/WebApplication.php
public function run() {
        try {
            $request  = $this->getLoops()->getService("request");
            $response = $this->getLoops()->getService("response");
            $web_core = $this->getLoops()->getService("web_core");

            //dispatch request
            echo $web_core->dispatch($this->url, $request, $response);
        }
        catch(Throwable $exception) {
            http_response_code(500);

            try {
                $renderer = $this->getLoops()->getService("renderer");
                echo $renderer->render($exception);
            }
            catch(Throwable $render_exception) {
                Misc::displayException($exception);
            }
        }
    }
public function run() {
        try {
            $request  = $this->getLoops()->getService("request");
            $response = $this->getLoops()->getService("response");
            $web_core = $this->getLoops()->getService("web_core");

            //dispatch request
            echo $web_core->dispatch($this->url, $request, $response);
        }
        catch(Throwable $exception) {
            http_response_code(500);

            try {
                $renderer = $this->getLoops()->getService("renderer");
                echo $renderer->render($exception);
            }
            catch(Throwable $render_exception) {
                Misc::displayException($exception);
            }
        }
    }
public function run ( ) { try { $ request = $ this -> getLoops ( ) -> getService ( "request" ) ; $ response = $ this -> getLoops ( ) -> getService ( "response" ) ; $ web_core = $ this -> getLoops ( ) -> getService ( "web_core" ) ; //dispatch request echo $ web_core -> dispatch ( $ this -> url , $ request , $ response ) ; } catch ( Throwable $ exception ) { http_response_code ( 500 ) ; try { $ renderer = $ this -> getLoops ( ) -> getService ( "renderer" ) ; echo $ renderer -> render ( $ exception ) ; } catch ( Throwable $ render_exception ) { Misc :: displayException ( $ exception ) ; } } }
Runs the request by by dispaching the request via the web core service.
This method will print the resulting output and set http status codes accordingly.
Exceptions will be caught and rendered.
Runs the request by by dispaching the request via the web core service . This method will print the resulting output and set http status codes accordingly . Exceptions will be caught and rendered .