TaoLer/vendor/composer/InstalledVersions.php

435 lines
8.7 KiB
PHP
Raw Normal View History

2020-10-28 15:31:11 +08:00
<?php
namespace Composer;
use Composer\Semver\VersionParser;
class InstalledVersions
{
private static $installed = array (
'root' =>
array (
2020-10-29 16:49:57 +08:00
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
2020-10-29 16:49:57 +08:00
'reference' => NULL,
'name' => 'taoser/taoler',
2020-10-28 15:31:11 +08:00
),
'versions' =>
array (
'firebase/php-jwt' =>
array (
'pretty_version' => 'v5.3.0',
'version' => '5.3.0.0',
'aliases' =>
array (
),
'reference' => '3c2d70f2e64e2922345e89f2ceae47d2463faae1',
),
2020-10-28 15:31:11 +08:00
'league/flysystem' =>
array (
'pretty_version' => '1.1.3',
'version' => '1.1.3.0',
'aliases' =>
array (
),
'reference' => '9be3b16c877d477357c015cec057548cf9b2a14a',
),
'league/flysystem-cached-adapter' =>
array (
'pretty_version' => '1.1.0',
'version' => '1.1.0.0',
'aliases' =>
array (
),
'reference' => 'd1925efb2207ac4be3ad0c40b8277175f99ffaff',
),
'league/mime-type-detection' =>
array (
'pretty_version' => '1.7.0',
'version' => '1.7.0.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => '3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3',
),
'lotofbadcode/phpspirit_databackup' =>
array (
'pretty_version' => 'v1.1',
'version' => '1.1.0.0',
'aliases' =>
array (
),
'reference' => '2627b2e4206031731c94c8d637fb06b3b96e8860',
2020-10-28 15:31:11 +08:00
),
'phpmailer/phpmailer' =>
array (
2021-05-10 13:59:58 +08:00
'pretty_version' => 'v6.4.1',
'version' => '6.4.1.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
2021-05-10 13:59:58 +08:00
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d',
2020-10-28 15:31:11 +08:00
),
'psr/cache' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
),
'psr/container' =>
array (
2021-05-10 13:59:58 +08:00
'pretty_version' => '1.1.1',
'version' => '1.1.1.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
2021-05-10 13:59:58 +08:00
'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
2020-10-28 15:31:11 +08:00
),
'psr/log' =>
array (
2021-05-10 13:59:58 +08:00
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
2021-05-10 13:59:58 +08:00
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
2020-10-28 15:31:11 +08:00
),
'psr/simple-cache' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
),
'symfony/polyfill-mbstring' =>
array (
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => '2df51500adbaebdc4c38dea4c89a2e131c45c8a1',
2020-10-28 15:31:11 +08:00
),
'symfony/polyfill-php72' =>
array (
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976',
2020-10-28 15:31:11 +08:00
),
'symfony/polyfill-php80' =>
array (
'pretty_version' => 'v1.23.0',
'version' => '1.23.0.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0',
2020-10-28 15:31:11 +08:00
),
'symfony/var-dumper' =>
array (
'pretty_version' => 'v4.4.25',
'version' => '4.4.25.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => '31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0',
2020-10-28 15:31:11 +08:00
),
'taoser/taoler' =>
2020-10-28 15:31:11 +08:00
array (
'pretty_version' => '1.0.0+no-version-set',
2020-10-28 15:31:11 +08:00
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => NULL,
2020-10-28 15:31:11 +08:00
),
'taoser/think-auth' =>
2020-10-28 15:31:11 +08:00
array (
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => '19bb04e4fb957a95ff3fdc142939922c19167b43',
2020-10-28 15:31:11 +08:00
),
'topthink/framework' =>
2020-10-28 15:31:11 +08:00
array (
2021-05-10 13:59:58 +08:00
'pretty_version' => 'v6.0.8',
'version' => '6.0.8.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
2021-05-10 13:59:58 +08:00
'reference' => '4789343672aef06d571d556da369c0e156609bce',
2020-10-28 15:31:11 +08:00
),
'topthink/think-captcha' =>
array (
'pretty_version' => 'v3.0.3',
'version' => '3.0.3.0',
'aliases' =>
array (
),
'reference' => '1eef3717c1bcf4f5bbe2d1a1c704011d330a8b55',
),
'topthink/think-helper' =>
array (
'pretty_version' => 'v3.1.4',
'version' => '3.1.4.0',
'aliases' =>
array (
),
'reference' => 'c28d37743bda4a0455286ca85b17b5791d626e10',
),
'topthink/think-multi-app' =>
array (
'pretty_version' => 'v1.0.14',
'version' => '1.0.14.0',
'aliases' =>
array (
),
'reference' => 'ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3',
),
'topthink/think-orm' =>
array (
2021-05-10 13:59:58 +08:00
'pretty_version' => 'v2.0.40',
'version' => '2.0.40.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
2021-05-10 13:59:58 +08:00
'reference' => '1119d979b850849f3725856460cf108eec1c3eb8',
2020-10-28 15:31:11 +08:00
),
'topthink/think-template' =>
array (
'pretty_version' => 'v2.0.8',
'version' => '2.0.8.0',
2020-10-28 15:31:11 +08:00
'aliases' =>
array (
),
'reference' => 'abfc293f74f9ef5127b5c416310a01fe42e59368',
2020-10-28 15:31:11 +08:00
),
'topthink/think-trace' =>
array (
'pretty_version' => 'v1.4',
'version' => '1.4.0.0',
'aliases' =>
array (
),
'reference' => '9a9fa8f767b6c66c5a133ad21ca1bc96ad329444',
),
'topthink/think-view' =>
array (
'pretty_version' => 'v1.0.14',
'version' => '1.0.14.0',
'aliases' =>
array (
),
'reference' => 'edce0ae2c9551ab65f9e94a222604b0dead3576d',
),
2021-05-10 13:59:58 +08:00
'wamkj/thinkphp6.0-databackup' =>
array (
'pretty_version' => 'v1.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => '28a0e406d827132942723a3c9f69bb20c98e652f',
),
2020-10-28 15:31:11 +08:00
'zzstudio/think-addons' =>
array (
'pretty_version' => '2.0.5',
'version' => '2.0.5.0',
'aliases' =>
array (
),
'reference' => '7eb740cb219a111d593a05ad88248a74f640fe5c',
),
),
);
public static function getInstalledPackages()
{
return array_keys(self::$installed['versions']);
}
public static function isInstalled($packageName)
{
return isset(self::$installed['versions'][$packageName]);
}
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
public static function getVersionRanges($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
$ranges = array();
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
public static function getVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['version'])) {
return null;
}
return self::$installed['versions'][$packageName]['version'];
}
public static function getPrettyVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return self::$installed['versions'][$packageName]['pretty_version'];
}
public static function getReference($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['reference'])) {
return null;
}
return self::$installed['versions'][$packageName]['reference'];
}
public static function getRootPackage()
{
return self::$installed['root'];
}
public static function getRawData()
{
return self::$installed;
}
public static function reload($data)
{
self::$installed = $data;
}
}