System/Facade/RequestHandler.php
/**
     * @todo Implement page not found
     * reads all the calls and the maps that been registered and routes them to the appropreit controller
     * otherwise it shows 404 not found page <b>To be implemented.... listed in todo</b>
     */
@todo Implement page not found
reads all the calls and the maps that been registered and routes them to the appropreit controller
otherwise it shows 404 not found page To be implemented.... listed in todo
@todo Implement page not found reads all the calls and the maps that been registered and routes them to the appropreit controller otherwise it shows 404 not found page To be implemented .... listed in todo
public function listen(){
        $this->server = filter_input_array(INPUT_SERVER);
        if(!empty($this->server['PATH_INFO'])){
            $this->setPathInfo($this->server['PATH_INFO']);
        }else{
            $this->setPathInfo(null,true);
        }
        $controllerName = '';
        if(empty($this->pathInfo[0])){
            $controllerName = $this->defaultApplicationController;
        }else{
            $controllerName = array_shift($this->pathInfo);
        }
        $controllerMethodName = array_shift($this->pathInfo);
        if($this->isMapped($controllerName) || $this->isMapped($controllerMethodName)){ 
            echo 'page not found'; return;
        }
        $pathControllerName = $this->getMapped(ucfirst(strtolower($controllerName)));
        $pathControllerMethod = $this->getMapped(ucfirst(strtolower($controllerMethodName))?:ucfirst(strtolower(self::MAIN_METHOD_NAME)));
        $this->methodParams = array_values($this->pathInfo);
        while($this->callStack->valid()){
            $call = $this->callStack->current();
            if(strtolower($call['callName']) == strtolower($this->server['REQUEST_METHOD'])){
                $methodName = $call['callName'].'Actual';
                if(ucfirst(strtolower($call['controllerName'])) == $pathControllerName && ucfirst(strtolower($call['controllerMethod'])) == $pathControllerMethod){
                    $this->$methodName($pathControllerName, $pathControllerMethod);
                }
            }
            $this->callStack->next();
        }
    }
public function listen ( ) { $ this -> server = filter_input_array ( INPUT_SERVER ) ; if ( ! empty ( $ this -> server [ 'PATH_INFO' ] ) ) { $ this -> setPathInfo ( $ this -> server [ 'PATH_INFO' ] ) ; } else { $ this -> setPathInfo ( null , true ) ; } $ controllerName = '' ; if ( empty ( $ this -> pathInfo [ 0 ] ) ) { $ controllerName = $ this -> defaultApplicationController ; } else { $ controllerName = array_shift ( $ this -> pathInfo ) ; } $ controllerMethodName = array_shift ( $ this -> pathInfo ) ; if ( $ this -> isMapped ( $ controllerName ) || $ this -> isMapped ( $ controllerMethodName ) ) { echo 'page not found' ; return ; } $ pathControllerName = $ this -> getMapped ( ucfirst ( strtolower ( $ controllerName ) ) ) ; $ pathControllerMethod = $ this -> getMapped ( ucfirst ( strtolower ( $ controllerMethodName ) ) ? : ucfirst ( strtolower ( self :: MAIN_METHOD_NAME ) ) ) ; $ this -> methodParams = array_values ( $ this -> pathInfo ) ; while ( $ this -> callStack -> valid ( ) ) { $ call = $ this -> callStack -> current ( ) ; if ( strtolower ( $ call [ 'callName' ] ) == strtolower ( $ this -> server [ 'REQUEST_METHOD' ] ) ) { $ methodName = $ call [ 'callName' ] . 'Actual' ; if ( ucfirst ( strtolower ( $ call [ 'controllerName' ] ) ) == $ pathControllerName && ucfirst ( strtolower ( $ call [ 'controllerMethod' ] ) ) == $ pathControllerMethod ) { $ this -> $ methodName ( $ pathControllerName , $ pathControllerMethod ) ; } } $ this -> callStack -> next ( ) ; } }
@todo Implement page not found
 reads all the calls and the maps that been registered and routes them to the appropreit controller
 otherwise it shows 404 not found page <b>To be implemented.... listed in todo</b>
@todo Implement page not found reads all the calls and the maps that been registered and routes them to the appropreit controller otherwise it shows 404 not found page <b > To be implemented .... listed in todo< / b >