Esempio n. 1
0
        public string GetMaxSatisfyingPhpComposerVersionAndVerify(string version)
        {
            var versionInfo          = _phpComposerVersionProvider.GetVersionInfo();
            var maxSatisfyingVersion = SemanticVersionResolver.GetMaxSatisfyingVersion(
                version,
                versionInfo.SupportedVersions);

            if (string.IsNullOrEmpty(maxSatisfyingVersion))
            {
                var exception = new UnsupportedVersionException(
                    PhpConstants.PhpComposerName,
                    version,
                    versionInfo.SupportedVersions);
                _logger.LogError(
                    exception,
                    $"Exception caught, the version '{version}' is not supported for the Node platform.");
                throw exception;
            }

            return(maxSatisfyingVersion);
        }