Check if we should cache the request based on the params in the routematch

@param  RouteMatch $match
@param  array      $routeConfig
@return bool
429596
protected function checkParams(RouteMatch $match, $routeConfig)
    {
        if (!isset($routeConfig['params'])) {
            return true;
        }

        $params = (array) $routeConfig['params'];
        foreach ($params as $name => $value) {

            $param = $match->getParam($name, null);
            if (null === $param) {
                continue;
            }

            if (!$this->checkParam($param, $value)) {
                return false;
            }
        }

        return true;
    }
1185119
function routeMatch(route, url) {
  const matcher = `^${route.replace(/(:\w+)/g, '([\\w-]+)')}$`
  return url.match(matcher)
}
1037862
public function processRoute(ConfigObject $routeConfig)
    {
        // base route
        $callback = $this->isString($routeConfig->Callback) ? $routeConfig->Callback : $routeConfig->Callback->toArray();
        $route = new Route($routeConfig->Path, $callback);

        // route options
        if (($options = $routeConfig->get('Options', false)) !== false) {
            $route->setOptions($options->toArray());
        }

        // host
        if (($host = $routeConfig->get('Host', false)) !== false) {
            $route->setHost($host);
        }

        // schemes
        if (($schemes = $routeConfig->get('Schemes', false)) !== false) {
            $route->setSchemes($schemes);
        }

        // methods
        if (($methods = $routeConfig->get('Methods', false)) !== false) {
            $route->setMethods($methods->toArray());
        }

        // tags
        if (($tags = $routeConfig->get('Tags', false)) !== false) {
            $route->setTags($tags->toArray());
        }

        return $route;
    }
133765
public function match($requestUrl, $requestMethod = RequestMethodInterface::METHOD_GET)
    {
        $currentDir = dirname($_SERVER['SCRIPT_NAME']);

        foreach ($this->routes->all() as $routes) {
            // compare server request method with route's allowed http methods
            if (! in_array($requestMethod, (array)$routes->getMethods(), true)) {
                continue;
            }

            if ('/' !== $currentDir) {
                $requestUrl = str_replace($currentDir, '', $requestUrl);
            }

            $route = rtrim($routes->getRegex(), '/');
            $pattern = '@^' . preg_quote($this->basePath) . $route . '/?$@i';
            if (!preg_match($pattern, $requestUrl, $matches)) {
                continue;
            }

            $params = array();

            if (preg_match_all('/:([\w-%]+)/', $routes->getUrl(), $argument_keys)) {
                // grab array with matches
                $argument_keys = $argument_keys[1];

                // check arguments number

                if(count($argument_keys) !== (count($matches) -1)) {
                    continue;
                }

                // loop trough parameter names, store matching value in $params array
                foreach ($argument_keys as $key => $name) {
                    if (isset($matches[$key+1])) {
                        $params[$name] = $matches[$key+1];
                    }
                }
            }

            $routes->setParameters($params);
            $routes->dispatch();

            return $routes;
        }

        return false;
    }
336945
public function matches(Route $route, Request $request)
    {
        $path = $request->path() === '/' ? '/' : '/'.$request->path();

        return preg_match($route->getCompiled()->getRegex(), rawurldecode($path));
    }
1307481
protected function matchRequest(array $match, Request $request) : bool
    {
        if (!$request->is(trim($match['path'], '/'))) {
            return false;
        }

        $method = collect($match['method'])->filter()->map(function ($method) {
            return strtoupper($method);
        });

        return $method->isEmpty() || $method->contains($request->method());
    }
770831
public function match($pathinfo)
    {
        $routes = array();
        $this->debug(sprintf('match: Matching %s', $pathinfo));

        foreach ($this->matchers as $matcher) {
            try {
                $routes = $matcher->match($pathinfo);
                break;
            } catch (ResourceNotFoundException $e) {
            } catch (MethodNotAllowedException $e) {
            }
        }

        if (!isset($routes['_route']) || !isset($routes['_controller'])) {
            $mesg = 'match: No Routes Found.';
            $this->alert($mesg);
            throw new RoutingException($mesg);
        }

        $this->debug(sprintf('match: Route matched %s', $routes['_route']));

        return($routes);
    }
541263
protected function matchRegex()
    {
        // Match request against route table
        foreach ($this->routes as $route => $endpoint) {
            $result = $this->routeParser->parse($route);

            // Get regex
            $regex = $result[0];
            // Get param names
            $paramNames = $result[1];

            if (preg_match($regex, $this->requestUri, $matches)) {
                // Check if endpoint class exists
                if (!$this->endpointExists($endpoint)) {
                    // Endpoint class not found
                    throw new NotFound();
                } elseif (!$this->endpointMethodExists($endpoint, $this->requestMethod)) {
                    // Route found but method can't be found
                    throw new MethodNotAllowed();
                }

                // Set matched route
                $this->matchedRoute = $route;
                // Set matched endpoint
                $this->matchedEndpoint = $endpoint;
                // Set matched request method
                $this->matchedMethod = $this->requestMethod;

                // Remove all slashes from param values/matches
                $matches = array_diff($matches, ['/']);

                // Remove first value in the matches array since it wont be used
                array_shift($matches);

                // Loop through all params and match them with values and save the result
                // to the params array
                foreach ($paramNames as $key => $name) {
                    $this->params[$name] = (isset($matches[$key])) ? $matches[$key]: null;
                }

                // Match found, add it to the cache for later use
                $this->addToCache($this->requestUri);

                // Time to stop looking for more matches
                return true;
            }
        }

        return false;
    }
1155712
public function storeMatchResults(RouteContext $routeContext, array $matchResults, RouteTags $matchedTags = null)
    {
        if ($this->containsObject($matchResults)) {
            return;
        }
        $tags = $this->generateRouteTags($routeContext->getHttpRequest()->getRelativePath(), $matchResults);
        if ($matchedTags !== null) {
            $tags = array_unique(array_merge($matchedTags->getTags(), $tags));
        }
        $this->routeCache->set($routeContext->getCacheEntryIdentifier(), $matchResults, $tags);
    }
272441
private function getActionFromDynamicMatch($match)
    {
        if (array_key_exists("action", $match["params"])) {
            return $this->getActionFromParam($match["params"]["action"]);
        }

        if (array_key_exists("controller", $match["params"]) && !array_key_exists("action", $match["params"])) {
            return "index";
        }

        return "noActionMatch";
    }
1050628
public function matches( Route $route, Request $request )
	{
		if ( $route->httpOnly() )
			return !$request->secure();
		elseif ( $route->secure() )
			return $request->secure();

		return true;
	}
1166335
protected function getControllerResult(Match $match) : ResponseInterface
	{
		if ($match->controller === null) {
			$response = $this->dependencyContainer->get('fuel.application.response');
			return $response->withStatus(404);
		}

		$controller = $this->createController($match);
		$controllerResult = $controller->{$match->action}();

		// generate and send response
		// If the controller response is a response object then just pass that back out
		if ($controllerResult instanceof ResponseInterface) {
			return $controllerResult;
		}

		// Else update the application response with the controller result#
		/** @var ResponseInterface $response */
		$response = $this->dependencyContainer->get('fuel.application.response');
		$response->withStatus(200);
		return $response->withBody(new CallbackStream(
			function() use ($controllerResult) {
				return $controllerResult;
			}
		));
	}
1276675
public function matches(Route $route, Request $request)
    {
        /** @var \LaraPress\Routing\Route $route */
        return $route->wordpressConditional() == null || call_user_func($route->wordpressConditional(), $route->uri());
    }
282509
private function matchExact(): bool
    {
        foreach ($this->routesExact as $route) {
            if ($this->uri === $route['u']) { // compare the current URI array to this route URI array
                $this->control = $route['c']; // set control or this exact match

                return true; // exact match found
            }
        }

        return false; // exact match not found
    }
620025
public static function matchRoutePattern($routePattern, $path)
    {
        $expr = preg_replace('/\{([^}]+)\}/', '###', $routePattern);
        $expr = preg_quote($expr, '/');
        $expr = str_replace('###', '(.*)', $expr);
        $expr2 = preg_replace('/\(\.\*\)$/', '', $expr);
        $matched = preg_match('/^' . $expr . '\/?$/i', $path) || preg_match('/^' . $expr2 . '?$/i', $path);
        return $matched;
    }
773083
private function matchRoute($expectedRoute) {
		$params = [];

		// create the regex that matches paths against the route
		$expectedRouteRegex = $this->createRouteRegex($expectedRoute, $params);

		// if the route regex matches the current request path
		if (preg_match($expectedRouteRegex, $this->route, $matches)) {
			if (count($matches) > 1) {
				// remove the first match (which is the full route match)
				array_shift($matches);

				// use the extracted parameters as the arguments' keys and the matches as the arguments' values
				return array_combine($params, $matches);
			}
			else {
				return [];
			}
		}
		// if the route regex does not match the current request path
		else {
			return null;
		}
	}
764707
public function checkUrlMatch($pattern, $url)
    {
        $url = trim($url, '/');
        if (!$url) {
            $url = '/';
        }
        $matcher = $this->getPatternRegexp($pattern);
        if (preg_match($matcher, $url, $matches)) {
            return true;
        }
        return false;
    }