Builds asset file path based on the provided $url.

@param string $url Asset URL
@return string|void Absolute path for asset file
166532
protected function _getAssetFile($url)
    {
        $parts = explode('/', $url);
        $pluginPart = [];
        $plugin = false;
        for ($i = 0; $i < 2; $i++) {
            if (!isset($parts[$i])) {
                break;
            }
            $pluginPart[] = Inflector::camelize($parts[$i]);
            $possiblePlugin = implode('/', $pluginPart);
            if ($possiblePlugin && Plugin::loaded($possiblePlugin)) {
                $plugin = $possiblePlugin;
                $parts = array_slice($parts, $i + 1);
                break;
            }
        }

        $isAssetRequest = (isset($parts[0]) && $parts[0] === 'ASSETS');
        if ($isAssetRequest && Configure::read('debug')) {
            $parts = array_slice($parts, 1);
        } else {
            $isAssetRequest = false;
        }

        if ($plugin && Plugin::loaded($plugin)) {
            return $this->_getPluginAsset($plugin, $parts, $isAssetRequest);
        } else {
            return $this->_getAppAsset($parts, $isAssetRequest);
        }
    }
1145698
public function createImageFromUrl($url)
    {
        $file = wei()->file->downloadOnDemand($url);
        $file = file_get_contents($file);

        return imagecreatefromstring($file);
    }
1037351
public function setUrl($url)
    {
        if (! empty($url)) {
            $segments = parse_url($url);

            foreach ($segments as $key => $value) {
                $this->$key = $value;
            }

            if ($this->format = pathinfo($this->path, PATHINFO_EXTENSION)) {
                $this->path = str_replace('.'.$this->format, '', $this->path);
            }
        }

        return $this;
    }
852283
public function cachedAssetUrl($url)
    {
        $filePath = $this->path . '/' . \ltrim($url, '/');

        if (!\file_exists($filePath)) {
            throw new \LogicException(
                'Unable to locate the asset "' . $url . '" in the "' . $this->path . '" directory.'
            );
        }

        $lastUpdated = \filemtime($filePath);
        $pathInfo = \pathinfo($url);

        if ($pathInfo['dirname'] === '.') {
            $directory = '';
        } elseif ($pathInfo['dirname'] === '/') {
            $directory = '/';
        } else {
            $directory = $pathInfo['dirname'] . '/';
        }

        if ($this->filenameMethod) {
            return $directory . $pathInfo['filename'] . '.' . $lastUpdated . '.' . $pathInfo['extension'];
        }

        return $directory . $pathInfo['filename'] . '.' . $pathInfo['extension'] . '?v=' . $lastUpdated;
    }
1127440
public static function getPathFromURL($url)
	{
		$path = str_replace(self::getProtocolFromURL($url) . '://', '', $url);
		$path = str_replace(self::getDomainFromURL($url), '', $path);
		
		if($path == '') return '/';
		
		return $path;
	}
1127694
function assetPath(url) {
  const parsedUrl = path.parse(url.getValue());
  return compiler.types.String('url("' + parsedUrl.base + '")');
}
1259967
private function getRequestPath($url) {
		$urlParts = parse_url($url);
		$path = $urlParts['path'];
		if (isset($urlParts['query'])) {
			$path .= '?' . $urlParts['query'];
		}
		if (isset($urlParts['fragment'])) {
			$path .= '#' . $urlParts['fragment'];
		}
		return $path;
	}
101119
protected function _getAssetFile($url) {
		$parts = explode('/', $url);
		if ($parts[0] === 'theme') {
			$themeName = $parts[1];
			unset($parts[0], $parts[1]);
			$fileFragment = implode(DS, $parts);
			$path = App::themePath($themeName) . 'webroot' . DS;
			return $path . $fileFragment;
		}

		$plugin = Inflector::camelize($parts[0]);
		if ($plugin && CakePlugin::loaded($plugin)) {
			unset($parts[0]);
			$fileFragment = implode(DS, $parts);
			$pluginWebroot = CakePlugin::path($plugin) . 'webroot' . DS;
			return $pluginWebroot . $fileFragment;
		}

		$webroot = APP . 'webroot' . DS;
		$fileFragment = implode(DS, $parts);
		if (file_exists($webroot . $parts[0])) {
			return $webroot . $fileFragment;
		}

		$router = Router::parse($url);
		if (strpos($router['controller'], '.') !== false || strpos($router['action'], '.') !== false) {
			return 'webroot' . DS . $fileFragment;
		}
	}
684582
public static function getInternalPath($url)
    {
        $path = parse_url($url, PHP_URL_PATH);

        return ($path === '/') ? $path : ltrim($path, '/');
    }
26403
private static function setRoot($url)
    {
        $segements = explode('/', $url);
        $count = count($segements) - 2;

        $path = '';

        for ($i = 0; $i < $count; $i++) {
            $path .= '../';
        }

        Application::$path .= $path;

        return Application::$path;
    }
1369721
public function themeUrl($url = null)
    {
        $themeDir = $this->getTheme()->getDirName();

        if (is_array($url)) {
            $_url = Url::to(CombineAssets::combine($url, themes_path().'/'.$themeDir));
        }
        else {
            $_url = Config::get('cms.themesPath', '/themes').'/'.$themeDir;
            if ($url !== null) {
                $_url .= '/'.$url;
            }
            $_url = Url::asset($_url);
        }

        return $_url;
    }
789087
public static function getTransformPathForUrl($url): string
    {
        /** @var ConfigModel $settings */
        $config = ImagerService::getConfig();

        $urlParts = parse_url($url);
        $pathParts = pathinfo($urlParts['path']);
        $hashRemoteUrl = $config->getSetting('hashRemoteUrl');
        $hashPath = $config->getSetting('hashPath');
        $shortHashLength = $config->getSetting('shortHashLength');
        $transformPath = $pathParts['dirname'];

        if ($hashPath) {
            $transformPath = '/' . md5($pathParts['dirname']);
        }

        if ($hashRemoteUrl) {
            if (\is_string($hashRemoteUrl) && $hashRemoteUrl === 'host') {
                $transformPath = '/' . substr(md5($urlParts['host']), 0, $shortHashLength) . $transformPath;
            } else {
                $transformPath = '/' . md5($urlParts['host'] . $pathParts['dirname']);
            }
        } else {
            $transformPath = '/' . str_replace('.', '_', $urlParts['host']) . $transformPath;
        }

        return FileHelper::normalizePath($transformPath);
    }
393603
protected function createUrl($url)
    {
        // is absolute URL?
        if (strpos($url, '://')) {
            return Url::createFromUrl($url);
        }

        // only query and path matters in relative url
        $url = Url::createFromUrl($url);
        $query = $this->baseUrl->getQuery();
        $path = $this->baseUrl->getPath();

        $query->modify($url->getQuery());
        $path->append($url->getPath());

        return $this->baseUrl->setQuery($query)->setPath($path);
    }
256400
public function buildUrl(string $url): string
    {
        if (filter_var($url, FILTER_VALIDATE_URL)) {
            return $url;
        }
        return $this->endPoint . static::ENDPOINT_SUFFIX . $url;
    }
419492
private function buildUrl($url)
    {
        // URI template (absolute or relative)
        if (!is_array($url)) {
            return strpos($url, '://')
                ? (string) $url
                : (string) $this->baseUrl->combine($url);
        }

        if (!isset($url[1])) {
            throw new \InvalidArgumentException('You must provide a hash of '
                . 'varname options in the second element of a URL array.');
        }

        // Absolute URL
        if (strpos($url[0], '://')) {
            return Utils::uriTemplate($url[0], $url[1]);
        }

        // Combine the relative URL with the base URL
        return (string) $this->baseUrl->combine(
            Utils::uriTemplate($url[0], $url[1])
        );
    }
724276
public function getUrl (string $assetPath) : string
    {
        return $this->assetUrl->generateUrl(
            Asset::createFromAssetPath($assetPath)
        );
    }
1230556
public function src($url) {
		if(preg_match('/\.css/', $url)) $url = $url . '?v=' . time();
		return (self::webRoot() != '') ? '/' . self::webRoot() . "/src/$url" : "/src/$url";
	}