{{info}}
{{msg}}
  
  1. }
  2. public function match(Request $request, $pathArray){
  3. //默认页
  4. if($request->path()=='/'){
  5. $this->index->method($this->indexAction);
  6. return $this->index;
  7. }
  8. if(count($pathArray)==1){
  9. $this->index->method($pathArray[0]);
  10. return $this->index;
  11. }
  12. //拥有分组
  13. /* @var $group RouterGroup */
  14. $group=$this->groups[$pathArray[0]];
  15. if($group){
  16. array_shift($pathArray);
  17. $adapter=$group->match($request,$pathArray);
  18. if($adapter)return $adapter;
  19. }
  20. /* @var $pattern RouterPattern */
  21. foreach ($this->routerPattern as $pattern) {
  22. $adapter=$pattern->match($request,$pathArray);
  23. if($adapter)return $adapter;
  24. }
  25. return $this->miss;
  26. }
  27. }
trace调用栈
    
  1. rap\web\mvc\Router->match(...)
  2. rap\web\mvc\RouterHandlerMapping->map(...)
  3. rap\web\mvc\Dispatcher->doDispatch(...)
  4. rap\web\Application->start(...)
  5. require(...)