public function getUrl($file, $referenceType = UrlGenerator::ABSOLUTE_PATH)
{
if (!($url = $this->getPathInfo($file, 'url'))) {
return false;
}
if ($referenceType === UrlGenerator::ABSOLUTE_PATH) {
$url = strlen($path = parse_url($url, PHP_URL_PATH)) > 1 ? substr($url, strpos($url, $path)) : '/';
} elseif ($referenceType === UrlGenerator::NETWORK_PATH) {
$url = substr($url, strpos($url, '//'));
}
return $url;
}