Get the URL to the CDN for an asset.

@param string $source

@return string
350240
public function cdn($source)
	{
		$url = str_ireplace($this->public_path, '', $this->assets_path . '/' . ltrim($source, '/'));
		$url = $this->cdn ? $this->cdn . $url : $url;
		return $url;
	}
643996
public function get_asset_url( $file ) {
		if ( $this->get_wp_filesystem()->is_file( $file ) ) {
			$file = str_replace( plugin_dir_path( $this->plugin_file ), '', $file );
		}

		return plugins_url( $file, $this->plugin_file );
	}
164059
public function get_file_source_info($source) {
        global $USER;
        list($type, $fileid, $filename) = $this->split_part($source);
        return 'Box ('. fullname($USER) . '): ' . $filename;
    }
635289
public static function getAssetsUrl($forceCopyAssets = false, $cdn = false)
    {
        if (!isset(static::$assetsUrl)) {
            if ($cdn) {
                static::$assetsUrl = '//cdn.jsdelivr.net/foundation/4.3.1/';
            } else {
                $assetsPath        = static::getAssetsPath();
                static::$assetsUrl = \Yii::app()->assetManager->publish($assetsPath, true, -1, $forceCopyAssets);
            }
        }
        return static::$assetsUrl;
    }
765323
public function asset($asset)
    {
        list($name, $url) = explode(':', $asset);

        $baseUrl = str_replace(public_path(), '', $this->getAssetsPath());

        $url = $this->app['url']->asset($baseUrl."/{$name}/".$url);

        return str_replace(['http://', 'https://'], '//', $url);
    }
214353
public function getSourceRow($source)
    {
        if (strpos($source, PHP_EOL) === false) {
            return $this->indentionStr . $source . PHP_EOL;
        }

        $ret = '';
        $rows = explode(PHP_EOL, $source);
        if (strlen(trim($rows[0])) == 0) {
            $rows = array_splice($rows, 1);
        }
        if (strlen(trim($rows[(count($rows) - 1)])) == 0) {
            $rows = array_splice($rows, 0, count($rows) - 1);
        }
        foreach ($rows as $row) {
            $ret .= $this->indentionStr . $row . PHP_EOL;
        }

        return $ret;
    }
928776
public function path($source)
	{
		if (false === stristr($source, '::')) {
			return $this->assets_path . '/' . ltrim($source, '/');
		}
		
		$source_parts = explode('::', $source);
		$package_name = current($source_parts);
		
		// Is this relative to the public dir?
		$path = '/public/' . ltrim(end($source_parts), '/');
		if ('/' === substr(end($source_parts), 0, 1)) {
			$path = end($source_parts);
		}
		
		// Check local cache first.
		if (array_key_exists($package_name, static::$cached_paths)) {
			return static::$cached_paths[$package_name] . $path;
		}
		
		$finder = \Symfony\Component\Finder\Finder::create();
		
		// Try to find in workbench, first.
		$workbench = base_path() . '/workbench';
		if (file_exists($workbench . '/' . $package_name . $path)) {
			return $workbench . '/' . $package_name . $path;
		}
		
		// Use package path.
		$vendor = base_path() . '/vendor';
		return $vendor . '/' . $package_name . $path;
	}
1294102
public function getUrl($document)
    {
        $environment = $document->getEnvironment();

        return $environment->getUrl() . '.' . $this->kernel->getFileExtension();
    }
1162040
public function get_file_reference($source) {
        global $USER;
        list($type, $fileid, $filename) = $this->split_part($source);
        $reference = new stdClass();
        $reference->fileid = $fileid;
        $reference->filename = $filename;
        $reference->userid = $USER->id;
        $reference->downloadurl = '';
        if (optional_param('usefilereference', false, PARAM_BOOL)) {
            try {
                $shareinfo = $this->boxnetclient->share_file($reference->fileid);
            } catch (moodle_exception $e) {
                throw new repository_exception('cannotcreatereference', 'repository_boxnet');
            }
            $reference->downloadurl = $shareinfo->download_url;
        }
        return serialize($reference);
    }
850308
public function getImgixUrl (Asset $asset)
    {
        $url      = null;
        $domains  = $this->settings->imgixDomains;
        $volume   = $asset->getVolume();
        $assetUrl = AssetsHelper::generateUrl($volume, $asset);
        $assetUri = parse_url($assetUrl, PHP_URL_PATH);

        if ( isset($domains[ $volume->handle ]) ) {
            $builder = new UrlBuilder($domains[ $volume->handle ]);
            $builder->setUseHttps(true);
            if ($token = Imgix::$plugin->getSettings()->imgixSignedToken)
                $builder->setSignKey($token);
            $url = UrlHelper::stripQueryString($builder->createURL($assetUri));
        }


        return $url;
    }
1113875
public function assetUrl($source, array $options = [])
    {
        $assetPath = $this->assetPath($source, $options);

        return URL::asset($assetPath, Request::secure());
    }
608594
protected function getAssetSourceUrlWithModifiedTime(string $source, string $file): string
    {
        if ($this->isLocalPath($source) && $this->useVersioning) {
            // We can only append mtime to locally defined path since we need
            // to extract the file.

            if (! empty($modified = $this->files->lastModified($file))) {
                $source = $source."?{$modified}";
            }
        }

        return $source;
    }
980837
public static function getUrl($resource, $absolute = false) {
		if (strpos ( $resource, '//' ) !== false) {
			return $resource;
		}
		if ($absolute) {
			return self::$siteURL . self::ASSETS_FOLDER . $resource;
		}
		return ltrim ( self::ASSETS_FOLDER, '/' ) . $resource;
	}
1330925
public function getOfflineUrl($quality = null)
    {
        $deferred = new Deferred();

        $valid = [self::QUALITY_LOSSLESS, self::QUALITY_HIGH, self::QUALITY_LOW];

        if (array_search($quality, $valid) === false) {
            $quality = self::QUALITY_HIGH;
        }

        $options = Options::buildOptions([
            'soundQuality' => $quality,
        ], [], $this->tidal);

        $this->http->get(
            Options::replace(Endpoints::TRACK_OFFLINE_URL, ['id' => $this->id]).$options
        )->then(function ($response) use ($deferred) {
            $deferred->resolve(new StreamUrl($this->http, $this->tidal, $response));
        }, function ($e) use ($deferred) {
            $deferred->reject($e);
        });

        return $deferred->promise();
    }
1105019
public function getUrlFromPath($assetPath)
    {
        // Ensure platform independency
        $path = str_replace('\\', '/', $assetPath);

        $filePath = pathinfo($path);

        $fileType = array_key_exists(strtolower($filePath['extension']), config('nodes.assets.providers.publicFolder.imageExtensionMimeTypes')) ? 'images' : 'data';

        // If the asset is type 'data', show the raw file. If it's 'image' we want to use the CDN
        if ($fileType == 'data') {
            return  $this->getUrlProtocol().config('nodes.assets.providers.publicFolder.domain').'/'.config('nodes.assets.providers.publicFolder.subFolder').'/'.$path;
        } else {
            $fileParts = explode('/', $path);

            return route('nodes.assets.public_folder.cdn', $fileParts);
        }
    }
1357252
public function getRealUrl($url)
	{
		if (config('services.cdn.base_url')) {
			$s3_url = self::$s3_base_url . config('filesystems.disks.s3.bucket') . '/';

			return str_replace($s3_url, config('services.cdn.base_url'), $url);
		} else {
			return $url;
		}
	}
1083526
public static function resolveUrl(AssetInterface $asset, $url)
    {
        // given URL is absolute URL
        if (false !== strpos($url, '://')) {
            return $url;
        }

        // source directory of the asset
        $root = dirname($asset->getSourceRoot().'/'.$asset->getTargetPath());

        // path directory where asset is being copied
        $path = dirname($asset->getTargetPath());

        if ('.' === $path) {
            $image = $url;
        } else {
            $image = $path.'/'.$url;
        }

        if (null !== $root) {
            $image = $root.'/'.$url;
        }

        // cleanup local URLs
        if (false === strpos($image, '://')) {
            $image = self::removeQueryString($image);
            $image = self::removeAnchor($image);

            return self::resolveUps($image);
        }

        return $image;
    }