Exemple #1
0
 public static function process()
 {
     $request_method = X::getEnv('request_method');
     // get 路由
     if ($request_method === 'GET') {
         foreach (self::$_get as $action) {
             self::__actionMatching($action);
         }
     }
     // post 路由
     if ($request_method === 'POST') {
         foreach (self::$_post as $action) {
             self::__actionMatching($action);
         }
     }
     // whole 路由
     foreach (self::$_route as $action) {
         self::__actionMatching($action);
     }
     if ($fn = X::getMap('notFound')) {
         $fn();
         exit;
     } else {
         X::throwException(sprintf("Can't find action:%s regular:%s", X::getEnv('action'), X::getEnv('queryUriRegular')));
     }
 }