예제 #1
0
 /**
  * Routes the contoroller for a given URI, and places contoller class name
  * into $this->_controller var
  * Found path is set into $this->_controller_ident, and all remaining parts
  * into $this->_controller_params
  *
  * @todo Move controller_ident and controller_params to the Request object
  *      
  * @uses Oops_Server_Router
  */
 function _routeRequest()
 {
     $this->_initRouter();
     if ($this->_router->route($this->_request)) {
         // Routed OK
         $this->_controller_ident = trim($this->_router->foundPath, '/');
         $this->_controller_params = strlen($this->_router->notFoundPath) ? explode('/', $this->_router->notFoundPath) : array();
     } else {
         // We got 404 here, let's work it out
         $this->_response->setCode(404);
     }
 }
예제 #2
0
 function __construct($filename)
 {
     set_error_handler(array($this, "_parseIniErrorHandler"));
     $data = parse_ini_file($filename, true);
     restore_error_handler();
     if ($this->_parseError) {
         trigger_error("Server_Router/InvalidIniFile/{$filename}", E_USER_WARNING);
         return;
     }
     foreach ($data as $controller => $sections) {
         foreach ($sections as $path => $title) {
             parent::Set($path, $controller);
         }
     }
 }