/** * Tries to match a URL based on Apache mod_rewrite matching. * * Returns false if no route matches the URL. * * @param string $url URL to be parsed * * @return array|false An array of parameters or false if no route matches */ public function match($url) { if (!isset($_SERVER['_ROUTING__route'])) { // fall-back to the default UrlMatcher return parent::match($url); } $parameters = array(); foreach ($_SERVER as $key => $value) { if ('_ROUTING_' === substr($key, 0, 9)) { $parameters[substr($key, 9)] = $value; unset($_SERVER[$key]); } } return $parameters; }