Get the version of url file dependency.

@param AssetTypeInterface $assetType The asset type
@param string             $url       The url
@param string             $version   The version

@return string The version
355269
protected static function getUrlFileDependencyVersion(AssetTypeInterface $assetType, $url, $version)
    {
        if ('#' !== $version) {
            return substr($version, 1);
        }

        if (preg_match('/(\d+)(\.\d+)(\.\d+)?(\.\d+)?/', $url, $match)) {
            return $assetType->getVersionConverter()->convertVersion($match[0]);
        }

        return '0.0.0.0';
    }
8451
static function version( $withRelease = true, $asAlias = false, $withState = true )
    {
        if ( $asAlias )
        {
            $versionText = eZPublishSDK::alias();
            if ( $withState && eZPublishSDK::state() )
                $versionText .= "-" . eZPublishSDK::state();
        }
        else
        {
            $versionText = eZPublishSDK::majorVersion() . '.' . eZPublishSDK::minorVersion();
//            $development = eZPublishSDK::developmentVersion();
//            if ( $development !== false )
//                $versionText .= '.' . $development;
            if ( $withRelease )
                $versionText .= "." . eZPublishSDK::release();
            if ( $withState )
                $versionText .= eZPublishSDK::state();
        }
        return $versionText;
    }
1355996
private function get_upgrade_notices( $version, $url ) {
		$slug = $this->get_plugin_slug( $url );
		if ( empty( $slug ) ) {
			return false;
		}

		$transient_name = 'upgrade_notice-' . $slug . '_' . $version;
		$upgrade_notice = get_transient( $transient_name );

		if ( false === $upgrade_notice ) {
			$upgrade_notice = $this->get_upgrade_notice( $slug );
			if ( $upgrade_notice ) {
				set_transient( $transient_name, $upgrade_notice, DAY_IN_SECONDS );
			}
		}

		return $upgrade_notice;
	}
193783
public function getVersion($assetPath)
    {
        $assetPath = parse_url($assetPath, PHP_URL_PATH);

        if ($this->webPrefix !== substr($assetPath, 0, strlen($this->webPrefix))) {
            return null;
        }

        $assetPath = substr($assetPath, strlen($this->webPrefix));

        if (isset($this->cache[$assetPath])) {
            return $this->cache[$assetPath];
        }

        return null;
    }
311387
protected static function extractVersion(string $version, string $expression): ?string
    {
        if (preg_match($expression, $version, $result)) {
            return Arr::first($result);
        }

        return null;
    }
1023106
public function findVersionOfFile($file, $version)
    {
        if($file == null || ($f2 = $this->findOriginalFileToVersion($file)) == null ||
            $file->getAbsoluteFilePath() != $f2->getAbsoluteFilePath()){
            return null;
        }
        $name = $this->versionFileName($file, $version);
        $f = new FileImpl($file->getParentFolder()->getAbsolutePath()."/".$name);
        return $this->containsFile($f)?$f:null;
    }
1127694
function assetPath(url) {
  const parsedUrl = path.parse(url.getValue());
  return compiler.types.String('url("' + parsedUrl.base + '")');
}
687322
private function getParameterVersion($parameterName, $url = null)
    {
        $versions = $this->findSiteVersions($url);
        $parameterVersion = $versions->first(function ($item) use ($parameterName) {
            return $item['parameter-name'] == $parameterName;
        });

        return $parameterVersion['version'];
    }
1079123
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return AssetVersionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            asset_sid=self._solution['asset_sid'],
            sid=self._solution['sid'],
        )
169272
private VersionControl getAssetVersionControl() throws IOException, DataAccessException {
        VersionControl vc = getVersionControl();
        if (vc == null)
            vc = DataAccess.getAssetVersionControl(assetRoot);
        return vc;
    }
929252
protected static function getUrlFileDependencyName(AssetTypeInterface $assetType, array $composer, $dependency)
    {
        $prefix = isset($composer['name'])
            ? substr($composer['name'], \strlen($assetType->getComposerVendorName()) + 1).'-'
            : '';

        return $prefix.$dependency.'-file';
    }
1247472
private function getAssetUrl($path)
    {
        $url = $this->assetsPackages->getUrl($path);
        if (!$url) {
            return $path;
        }

        /**
         * If `framework.assets.version: some_version` set, then $version = '?some_version'.
         * If `framework.assets: json_manifest_path` is used, then $version = '/'.
         */
        $version = $this->assetsPackages->getVersion($path);
        if (false === strpos($version, '?')) {
            return $url;
        }

        return preg_replace('/\?' . $version . '/', '', $url);
    }
558413
public function versionCompare($frameworkVersion, $compareVersion, $operator = null)
    {
        // Lumen (5.5.2) (Laravel Components 5.5.*)
        $lumenPattern = '/Lumen \((\d\.\d\.[\d|\*])\)( \(Laravel Components (\d\.\d\.[\d|\*])\))?/';

        if (preg_match($lumenPattern, $frameworkVersion, $matches)) {
            $frameworkVersion = isset($matches[3]) ? $matches[3] : $matches[1]; // Prefer Laravel Components version.
        }

        return version_compare($frameworkVersion, $compareVersion, $operator);
    }
9471
public static function assetJs($name, $version = false)
    {
        // Get cache
        $cache = Cache::get('potion_assets', []);

        // Check for asset
        if (!isset($cache[$name])) {
            return false;
        }

        // Url
        $url = self::assetUrl($name, $version);

        // Return
        return "<script type=\"text/javascript\" src=\"{$url}\"></script>";
    }
734806
public function getAssetUrl($type, $assetName)
    {
        $file = $this->assetManager->getAssetFile($type, $assetName);
        
        if ($file === false) {
            return;
        }
        
        $cachedFile = $this->generateCachedFile($type, $file->getFileName());
        
        return $this->getUrlToTheAssetLoader($cachedFile['file']);
    }
1087610
public function setAsset($url, $fileType)
    {
        $this->assetUrl = $url;
        $this->assetFileType = $fileType;
        return $this;
    }
1248445
public function mapBrowserVersion(?string $browserVersion, ?string $browserName = null): VersionInterface
    {
        if (null === $browserVersion) {
            return new Version();
        }

        switch (mb_strtolower($browserVersion)) {
            case '':
            case 'unknown':
            case 'other':
                return new Version();
                break;
            default:
                if (null === $browserName) {
                    return new Version();
                }

                switch (mb_strtolower($browserName)) {
                    case '':
                    case 'unknown':
                    case 'other':
                        return new Version();
                        break;
                    default:
                        // nothing to do here
                        break;
                }
                break;
        }

        return (new VersionFactory())->set($browserVersion);
    }