AssetCompress\Routing\Filter\AssetCompressorFilter::getName PHP Method

getName() protected method

Returns the build name for a requested asset
protected getName ( AssetConfig $config, string $url ) : boolean | string
$config MiniAsset\AssetConfig The config object to use.
$url string The url to get an asset name from.
return boolean | string false if no build can be parsed from URL with url path otherwise
    protected function getName($config, $url)
    {
        $parts = explode('.', $url);
        if (count($parts) < 2) {
            return false;
        }
        $path = $config->cachePath($parts[count($parts) - 1]);
        if (empty($path)) {
            return false;
        }
        $root = str_replace('\\', '/', WWW_ROOT);
        $path = str_replace('\\', '/', $path);
        $path = str_replace($root, '', $path);
        if (strpos($url, $path) !== 0) {
            return false;
        }
        return str_replace($path, '', $url);
    }