コード例 #1
0
 /**
  * @access public
  * @return void
  */
 public function run()
 {
     $bootstrap = new Bootstrap();
     $bootstrap->setCurrentController(DEFAULT_CONTROLLER);
     $bootstrap->setCurrentAction(DEFAULT_ACTION);
     $bootstrap->parseUrl();
     $route = $bootstrap->getRoute();
     if (!empty($this->routes[$route]['isOauthRequired']) && !Security::isUserLoggedIn()) {
         Helper::redirectTo(WEB . DEFAULT_ROUTE);
     } else {
         if (!empty($this->routes[$route]['controller'])) {
             $controller = $this->routes[$route]['controller'];
             $bootstrap->setController($controller);
         }
         $bootstrap->loadControllerFile();
         $bootstrap->initControllerClass();
         $bootstrap->runControllerAction($bootstrap->getAction(), $bootstrap->getParams());
     }
 }