public function isMatched($pathinfo, $index)
    {
        $pathinfo = $this->_urlRewrite($pathinfo);

        if (!empty($pathinfo)) {
            $res = explode('/', $pathinfo);
            $this->_controllerName = empty($res[0]) ? $this->_controllerName : ucfirst($res[0]);
            if (count($res) >= 2) {
                $this->_actionName = empty($res[1]) ? $this->_actionName : $res[1];
            }

            if (count($res) > 2) {
                $this->_pathParams = array_slice($res, 2);
            }
        } else {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('pathinfo is empty');
            }
        }

        // 检查控制器是否存在
        $className = "{$this->_controllerNs}\\{$this->_controllerName}";

        if (class_exists($className)) {

            // 检查方法是否存在，不存则则使用index方法
            if (!method_exists($className, $this->_actionName.'Action')) {
                $this->_actionName = 'index';
                if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                    $this->getLogger()->debug('use default action: indexAction');
                }
            }

            return true;
        }

        return false;
    }
public function isMatched($pathinfo, $index)
    {
        $pathinfo = $this->_urlRewrite($pathinfo);

        if (!empty($pathinfo)) {
            $res = explode('/', $pathinfo);
            $this->_controllerName = empty($res[0]) ? $this->_controllerName : ucfirst($res[0]);
            if (count($res) >= 2) {
                $this->_actionName = empty($res[1]) ? $this->_actionName : $res[1];
            }

            if (count($res) > 2) {
                $this->_pathParams = array_slice($res, 2);
            }
        } else {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('pathinfo is empty');
            }
        }

        // 检查控制器是否存在
        $className = "{$this->_controllerNs}\\{$this->_controllerName}";

        if (class_exists($className)) {

            // 检查方法是否存在，不存则则使用index方法
            if (!method_exists($className, $this->_actionName.'Action')) {
                $this->_actionName = 'index';
                if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                    $this->getLogger()->debug('use default action: indexAction');
                }
            }

            return true;
        }

        return false;
    }
public function isMatched ( $ pathinfo , $ index ) { $ pathinfo = $ this -> _urlRewrite ( $ pathinfo ) ; if ( ! empty ( $ pathinfo ) ) { $ res = explode ( '/' , $ pathinfo ) ; $ this -> _controllerName = empty ( $ res [ 0 ] ) ? $ this -> _controllerName : ucfirst ( $ res [ 0 ] ) ; if ( count ( $ res ) >= 2 ) { $ this -> _actionName = empty ( $ res [ 1 ] ) ? $ this -> _actionName : $ res [ 1 ] ; } if ( count ( $ res ) > 2 ) { $ this -> _pathParams = array_slice ( $ res , 2 ) ; } } else { if ( defined ( 'FOCUS_DEBUG' ) && FOCUS_DEBUG ) { $ this -> getLogger ( ) -> debug ( 'pathinfo is empty' ) ; } } // 检查控制器是否存在 $ className = "{$this->_controllerNs}\\{$this->_controllerName}" ; if ( class_exists ( $ className ) ) { // 检查方法是否存在，不存则则使用index方法 if ( ! method_exists ( $ className , $ this -> _actionName . 'Action' ) ) { $ this -> _actionName = 'index' ; if ( defined ( 'FOCUS_DEBUG' ) && FOCUS_DEBUG ) { $ this -> getLogger ( ) -> debug ( 'use default action: indexAction' ) ; } } return true ; } return false ; }
Determine whether the routing rules is matched.

@param string $pathinfo pathinfo
@param int    $index    rule index

@return bool
Determine whether the routing rules is matched .