}
public function match(Request $request, $pathArray){
//默认页
if($request->path()=='/'){
$this->index->method($this->indexAction);
return $this->index;
}
if(count($pathArray)==1){
$this->index->method($pathArray[0]);
return $this->index;
}
//拥有分组
/* @var $group RouterGroup */
$group=$this->groups[$pathArray[0]];
if($group){
array_shift($pathArray);
$adapter=$group->match($request,$pathArray);
if($adapter)return $adapter;
}
/* @var $pattern RouterPattern */
foreach ($this->routerPattern as $pattern) {
$adapter=$pattern->match($request,$pathArray);
if($adapter)return $adapter;
}
return $this->miss;
}
}
trace调用栈
rap\web\mvc\Router->match(...)rap\web\mvc\RouterHandlerMapping->map(...)rap\web\mvc\Dispatcher->doDispatch(...)rap\web\Application->start(...)require(...)