/** @internal */ private function findCachedFile($uri, $evaluate) { // TODO: find better way then this hack. // This is required if we keep assets on separate [sub]domain or we use base non-root URL for them. $cachedPath = $uri; $prefix = preg_quote($this->params->getCachePrefix(), '#'); $pattern = sprintf('#^((?:[a-z]+:)?//.*?)?(?:/\\w+[.]php)?(/%s.*?)$#i', $prefix); if (preg_match($pattern, $uri, $m)) { $cachedPath = $m[2]; } $cached = $this->params->getWebRoot() . $cachedPath; if (!$evaluate) { return $cached; } return $this->normalizeFilePath($cached); }