protected function compareRoute($route, RequestAbstract $request)
    {
        // Replace the normal route delimiter with the request route delimiter
        $route = str_replace('|', $request->getRouteDelimiter(), $route);
        
        // Split the two routes into parts
        $routeParts = explode($request->getRouteDelimiter(), $route);
        $targetRouteParts = explode($request->getRouteDelimiter(), trim($request->getRoute(), $request->getRouteDelimiter()));
        $numberOfTargetRouteParts = count($targetRouteParts);
        
        // If we have different number of parts between the two routes
        // there are not equal so we have no equal route.
        if (count($routeParts) != $numberOfTargetRouteParts) {
            return false;
        }
        
        // Define the data types
        $routeParams = array();
        $routeIndex = 0;
        
        // Loop through the route parts and compare each part
        for ($pos = 0; $pos < $numberOfTargetRouteParts; $pos++) {
            $part = $routeParts[$pos];
            $targetPart = $targetRouteParts[$pos];

            if ($targetPart != '' && preg_match('/\[(d|s)(?:\:([0-9a-zA-Z]*))?\]/', $part)) {
                list($key, $value) = $this->parseRouteParam($part, $targetPart);
                
                $routeParams[$routeIndex] = $value;
                $routeIndex++;
                
                if ($key !== '') {
                    $routeParams[$key] = $value;
                }
            } else if ($part !== $targetPart) {
                // The part isn't equal == the route can't be equal
                return false;
            }
        }

        // Save the route parameters in the request
        $request->setRouteParams($routeParams);
        
        return true;
    }
protected function compareRoute($route, RequestAbstract $request)
    {
        // Replace the normal route delimiter with the request route delimiter
        $route = str_replace('|', $request->getRouteDelimiter(), $route);
        
        // Split the two routes into parts
        $routeParts = explode($request->getRouteDelimiter(), $route);
        $targetRouteParts = explode($request->getRouteDelimiter(), trim($request->getRoute(), $request->getRouteDelimiter()));
        $numberOfTargetRouteParts = count($targetRouteParts);
        
        // If we have different number of parts between the two routes
        // there are not equal so we have no equal route.
        if (count($routeParts) != $numberOfTargetRouteParts) {
            return false;
        }
        
        // Define the data types
        $routeParams = array();
        $routeIndex = 0;
        
        // Loop through the route parts and compare each part
        for ($pos = 0; $pos < $numberOfTargetRouteParts; $pos++) {
            $part = $routeParts[$pos];
            $targetPart = $targetRouteParts[$pos];

            if ($targetPart != '' && preg_match('/\[(d|s)(?:\:([0-9a-zA-Z]*))?\]/', $part)) {
                list($key, $value) = $this->parseRouteParam($part, $targetPart);
                
                $routeParams[$routeIndex] = $value;
                $routeIndex++;
                
                if ($key !== '') {
                    $routeParams[$key] = $value;
                }
            } else if ($part !== $targetPart) {
                // The part isn't equal == the route can't be equal
                return false;
            }
        }

        // Save the route parameters in the request
        $request->setRouteParams($routeParams);
        
        return true;
    }
protected function compareRoute ( $ route , RequestAbstract $ request ) { // Replace the normal route delimiter with the request route delimiter $ route = str_replace ( '|' , $ request -> getRouteDelimiter ( ) , $ route ) ; // Split the two routes into parts $ routeParts = explode ( $ request -> getRouteDelimiter ( ) , $ route ) ; $ targetRouteParts = explode ( $ request -> getRouteDelimiter ( ) , trim ( $ request -> getRoute ( ) , $ request -> getRouteDelimiter ( ) ) ) ; $ numberOfTargetRouteParts = count ( $ targetRouteParts ) ; // If we have different number of parts between the two routes // there are not equal so we have no equal route. if ( count ( $ routeParts ) != $ numberOfTargetRouteParts ) { return false ; } // Define the data types $ routeParams = array ( ) ; $ routeIndex = 0 ; // Loop through the route parts and compare each part for ( $ pos = 0 ; $ pos < $ numberOfTargetRouteParts ; $ pos ++ ) { $ part = $ routeParts [ $ pos ] ; $ targetPart = $ targetRouteParts [ $ pos ] ; if ( $ targetPart != '' && preg_match ( '/\[(d|s)(?:\:([0-9a-zA-Z]*))?\]/' , $ part ) ) { list ( $ key , $ value ) = $ this -> parseRouteParam ( $ part , $ targetPart ) ; $ routeParams [ $ routeIndex ] = $ value ; $ routeIndex ++ ; if ( $ key !== '' ) { $ routeParams [ $ key ] = $ value ; } } else if ( $ part !== $ targetPart ) { // The part isn't equal == the route can't be equal return false ; } } // Save the route parameters in the request $ request -> setRouteParams ( $ routeParams ) ; return true ; }
Compares the target route with the found route in the routing table.

@access protected
@param string $route
@param \Zepi\Turbo\Request\RequestAbstract $request
@return boolean
Compares the target route with the found route in the routing table .