includes/RequestManager.php
/**
     * Generic method for serving all http requests
     *
     * @throws Exception
     */
Generic method for serving all http requests
@throws Exception
Generic method for serving all http requests @throws Exception
public static function serveRequest() {
        self::regenerateCsrfToken();
        if (self::isValidRequest()) {
            $resource = ResourceProvider::getResource();
            $controller = ResourceProvider::getControllerByResourceKey($resource->getKey());
            if (!empty($controller) && $controller instanceof AbstractController) {
                $controller->run($resource);
            } else {
                throw new Exception("Invalid controller requested, Exiting");
            }
        } else {
            Logger::getLogger()->logWarn('No CSRF token found. IP:' . print_r($_SERVER['REMOTE_ADDR'], true));
            if (self::isAjaxRequest()) {
                Response::sendFailureResponse('Something went wrong!');
            } else {
            }
        }
    }
public static function serveRequest ( ) { self :: regenerateCsrfToken ( ) ; if ( self :: isValidRequest ( ) ) { $ resource = ResourceProvider :: getResource ( ) ; $ controller = ResourceProvider :: getControllerByResourceKey ( $ resource -> getKey ( ) ) ; if ( ! empty ( $ controller ) && $ controller instanceof AbstractController ) { $ controller -> run ( $ resource ) ; } else { throw new Exception ( " Invalid controller requested, Exiting " ) ; } } else { Logger :: getLogger ( ) -> logWarn ( 'No CSRF token found. IP:' . print_r ( $ _SERVER [ 'REMOTE_ADDR' ] , true ) ) ; if ( self :: isAjaxRequest ( ) ) { Response :: sendFailureResponse ( 'Something went wrong!' ) ; } else { } } }
Generic method for serving all http requests
 @throws Exception
Generic method for serving all http requests @throws Exception