You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/vendor/composer/InstalledVersions.php

1088 lines
23 KiB

7 months ago
<?php
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
class InstalledVersions
{
private static $installed = array (
'root' =>
array (
6 months ago
'pretty_version' => 'dev-master',
'version' => 'dev-master',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => 'f1ed457e61fa36dc5b3d253f072677c61e8323fe',
7 months ago
'name' => 'topthink/think',
),
'versions' =>
array (
'adbario/php-dot-notation' =>
array (
6 months ago
'pretty_version' => '2.5.0',
'version' => '2.5.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '081e2cca50c84bfeeea2e3ef9b2c8d206d80ccae',
7 months ago
),
'aferrandini/phpqrcode' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => '3c1c0454d43710ab5bbe19a51ad4cb41c22e3d46',
),
'alibabacloud/tea' =>
array (
6 months ago
'pretty_version' => '3.2.1',
'version' => '3.2.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '1619cb96c158384f72b873e1f85de8b299c9c367',
7 months ago
),
'alibabacloud/tea-fileform' =>
array (
'pretty_version' => '0.3.4',
'version' => '0.3.4.0',
'aliases' =>
array (
),
'reference' => '4bf0c75a045c8115aa8cb1a394bd08d8bb833181',
),
'alipaysdk/easysdk' =>
array (
6 months ago
'pretty_version' => '2.2.3',
'version' => '2.2.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'c6008839a22a5fca08e9f8536730f7abfed522d5',
7 months ago
),
'aliyuncs/oss-sdk-php' =>
array (
6 months ago
'pretty_version' => 'v2.7.1',
'version' => '2.7.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'ce5d34dae9868237a32248788ea175c7e9da14b1',
7 months ago
),
6 months ago
'carbonphp/carbon-doctrine-types' =>
7 months ago
array (
6 months ago
'pretty_version' => '2.1.0',
'version' => '2.1.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '99f76ffa36cce3b70a4a6abce41dba15ca2e84cb',
7 months ago
),
'easywechat-composer/easywechat-composer' =>
array (
'pretty_version' => '1.4.1',
'version' => '1.4.1.0',
'aliases' =>
array (
),
'reference' => '3fc6a7ab6d3853c0f4e2922539b56cc37ef361cd',
),
'elastic/transport' =>
array (
'pretty_version' => 'v8.8.0',
'version' => '8.8.0.0',
'aliases' =>
array (
),
'reference' => 'cdf9f63a16ec6bfb4c881ab89aa0e2a61fb7c20b',
),
'elasticsearch/elasticsearch' =>
array (
5 months ago
'pretty_version' => 'v8.14.0',
'version' => '8.14.0.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => 'bff3c3e2402f6a20449404637f91a5ae214eff46',
7 months ago
),
'ezyang/htmlpurifier' =>
array (
6 months ago
'pretty_version' => 'v4.17.0',
'version' => '4.17.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'bbc513d79acf6691fa9cf10f192c90dd2957f18c',
7 months ago
),
'guzzlehttp/command' =>
array (
6 months ago
'pretty_version' => '1.3.1',
'version' => '1.3.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '0eebc653784f4902b3272e826fe8e88743d14e77',
7 months ago
),
'guzzlehttp/guzzle' =>
array (
6 months ago
'pretty_version' => '7.8.1',
'version' => '7.8.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '41042bc7ab002487b876a0683fc8dce04ddce104',
7 months ago
),
'guzzlehttp/guzzle-services' =>
array (
6 months ago
'pretty_version' => '1.4.1',
'version' => '1.4.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'bcab7c0d61672b606510a6fe5af3039d04968c0f',
7 months ago
),
'guzzlehttp/promises' =>
array (
6 months ago
'pretty_version' => '2.0.2',
'version' => '2.0.2.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'bbff78d96034045e58e13dedd6ad91b5d1253223',
7 months ago
),
'guzzlehttp/psr7' =>
array (
6 months ago
'pretty_version' => '2.6.2',
'version' => '2.6.2.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '45b30f99ac27b5ca93cb4831afe16285f57b8221',
7 months ago
),
'guzzlehttp/uri-template' =>
array (
6 months ago
'pretty_version' => 'v1.0.3',
'version' => '1.0.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'ecea8feef63bd4fef1f037ecb288386999ecc11c',
7 months ago
),
5 months ago
'huifurepo/dg-php-sdk' =>
array (
'pretty_version' => '2.0.11',
'version' => '2.0.11.0',
'aliases' =>
array (
),
'reference' => 'f9ba003fbc3c35e3e2ce7d0a1c05526f745dabdb',
),
7 months ago
'kosinix/grafika' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
0 => '9999999-dev',
),
'reference' => '211f61fc334b8b36616b23e8af7c5727971d96ee',
),
'league/flysystem' =>
array (
'pretty_version' => '2.5.0',
'version' => '2.5.0.0',
'aliases' =>
array (
),
'reference' => '8aaffb653c5777781b0f7f69a5d937baf7ab6cdb',
),
'league/mime-type-detection' =>
array (
6 months ago
'pretty_version' => '1.15.0',
'version' => '1.15.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301',
7 months ago
),
'lvht/geohash' =>
array (
'pretty_version' => 'v1.1.0',
'version' => '1.1.0.0',
'aliases' =>
array (
),
'reference' => 'bbba3e1b487f0ec2e5e666c1bc9d1d4277990a29',
),
'maennchen/zipstream-php' =>
array (
6 months ago
'pretty_version' => '2.2.6',
'version' => '2.2.6.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f',
7 months ago
),
'markbaker/complex' =>
array (
6 months ago
'pretty_version' => '3.0.2',
'version' => '3.0.2.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '95c56caa1cf5c766ad6d65b6344b807c1e8405b9',
7 months ago
),
'markbaker/matrix' =>
array (
6 months ago
'pretty_version' => '3.0.1',
'version' => '3.0.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '728434227fe21be27ff6d86621a1b13107a2562c',
7 months ago
),
'monolog/monolog' =>
array (
6 months ago
'pretty_version' => '2.9.3',
'version' => '2.9.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'a30bfe2e142720dfa990d0a7e573997f5d884215',
7 months ago
),
'myclabs/php-enum' =>
array (
6 months ago
'pretty_version' => '1.8.4',
'version' => '1.8.4.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483',
7 months ago
),
'nesbot/carbon' =>
array (
6 months ago
'pretty_version' => '2.72.5',
'version' => '2.72.5.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'afd46589c216118ecd48ff2b95d77596af1e57ed',
7 months ago
),
'overtrue/easy-sms' =>
array (
6 months ago
'pretty_version' => '2.7.1',
'version' => '2.7.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'd71d32f6631dda4c0da09c2831ff110a1c19873c',
7 months ago
),
'overtrue/socialite' =>
array (
5 months ago
'pretty_version' => '3.5.5',
'version' => '3.5.5.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => '3cf32be7ae0fd86f83e41ca7239aa10e04b8b401',
7 months ago
),
'overtrue/wechat' =>
array (
6 months ago
'pretty_version' => '5.35.1',
'version' => '5.35.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '80059817ca5456d2efb4f1b2417aa1df72e0ec58',
7 months ago
),
'php-http/async-client-implementation' =>
array (
'provided' =>
array (
0 => '*',
),
),
'php-http/client-implementation' =>
array (
'provided' =>
array (
0 => '*',
),
),
'php-http/discovery' =>
array (
'pretty_version' => '1.19.4',
'version' => '1.19.4.0',
'aliases' =>
array (
),
'reference' => '0700efda8d7526335132360167315fdab3aeb599',
),
'php-http/httplug' =>
array (
'pretty_version' => '2.4.0',
'version' => '2.4.0.0',
'aliases' =>
array (
),
'reference' => '625ad742c360c8ac580fcc647a1541d29e257f67',
),
'php-http/promise' =>
array (
'pretty_version' => '1.3.1',
'version' => '1.3.1.0',
'aliases' =>
array (
),
'reference' => 'fc85b1fba37c169a69a07ef0d5a8075770cc1f83',
),
'phpoffice/phpspreadsheet' =>
array (
6 months ago
'pretty_version' => '1.29.0',
'version' => '1.29.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'fde2ccf55eaef7e86021ff1acce26479160a0fa0',
7 months ago
),
'pimple/pimple' =>
array (
'pretty_version' => 'v3.5.0',
'version' => '3.5.0.0',
'aliases' =>
array (
),
'reference' => 'a94b3a4db7fb774b3d78dad2315ddc07629e1bed',
),
'psr/cache' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
),
'psr/cache-implementation' =>
array (
'provided' =>
array (
0 => '1.0|2.0',
),
),
6 months ago
'psr/clock' =>
array (
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d',
),
'psr/clock-implementation' =>
array (
'provided' =>
array (
0 => '1.0',
),
),
7 months ago
'psr/container' =>
array (
'pretty_version' => '1.1.2',
'version' => '1.1.2.0',
'aliases' =>
array (
),
'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
),
'psr/event-dispatcher' =>
array (
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0',
),
'psr/event-dispatcher-implementation' =>
array (
'provided' =>
array (
0 => '1.0',
),
),
'psr/http-client' =>
array (
6 months ago
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
7 months ago
),
'psr/http-client-implementation' =>
array (
'provided' =>
array (
5 months ago
0 => '1.0',
1 => '*',
7 months ago
),
),
'psr/http-factory' =>
array (
6 months ago
'pretty_version' => '1.1.0',
'version' => '1.1.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
7 months ago
),
'psr/http-factory-implementation' =>
array (
'provided' =>
array (
5 months ago
0 => '1.0',
1 => '*',
7 months ago
),
),
'psr/http-message' =>
array (
6 months ago
'pretty_version' => '1.1',
'version' => '1.1.0.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba',
7 months ago
),
'psr/http-message-implementation' =>
array (
'provided' =>
array (
5 months ago
0 => '1.0',
1 => '*',
7 months ago
),
),
'psr/log' =>
array (
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'aliases' =>
array (
),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
),
'psr/log-implementation' =>
array (
'provided' =>
array (
0 => '1.0.0 || 2.0.0 || 3.0.0',
),
),
'psr/simple-cache' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
),
'psr/simple-cache-implementation' =>
array (
'provided' =>
array (
0 => '1.0|2.0',
),
),
'qcloud/cos-sdk-v5' =>
array (
5 months ago
'pretty_version' => 'v2.6.11',
'version' => '2.6.11.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => '43a91c2d892888b670a9dac9744232f15e080a79',
7 months ago
),
'qiniu/php-sdk' =>
array (
6 months ago
'pretty_version' => 'v7.12.1',
'version' => '7.12.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '88952a65e97b4c2fae3f954bc4419ba14e42f154',
7 months ago
),
'ralouphie/getallheaders' =>
array (
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'aliases' =>
array (
),
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
),
'symfony/cache' =>
array (
6 months ago
'pretty_version' => 'v5.4.40',
'version' => '5.4.40.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '89005bc368ca02ed0433c592e4d27670d0844a66',
7 months ago
),
'symfony/cache-contracts' =>
array (
6 months ago
'pretty_version' => 'v2.5.3',
'version' => '2.5.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'fee6db04d913094e2fb55ff8e7db5685a8134463',
7 months ago
),
'symfony/cache-implementation' =>
array (
'provided' =>
array (
0 => '1.0|2.0',
),
),
'symfony/deprecation-contracts' =>
array (
6 months ago
'pretty_version' => 'v2.5.3',
'version' => '2.5.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '80d075412b557d41002320b96a096ca65aa2c98d',
7 months ago
),
'symfony/event-dispatcher' =>
array (
6 months ago
'pretty_version' => 'v5.4.40',
'version' => '5.4.40.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'a54e2a8a114065f31020d6a89ede83e34c3b27a4',
7 months ago
),
'symfony/event-dispatcher-contracts' =>
array (
6 months ago
'pretty_version' => 'v2.5.3',
'version' => '2.5.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '540f4c73e87fd0c71ca44a6aa305d024ac68cb73',
7 months ago
),
'symfony/event-dispatcher-implementation' =>
array (
'provided' =>
array (
0 => '2.0',
),
),
'symfony/http-foundation' =>
array (
6 months ago
'pretty_version' => 'v5.4.40',
'version' => '5.4.40.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'cf4893ca4eca3fac4ae06da1590afdbbb4217847',
7 months ago
),
'symfony/polyfill-mbstring' =>
array (
5 months ago
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c',
7 months ago
),
'symfony/polyfill-php72' =>
array (
5 months ago
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => '10112722600777e02d2745716b70c5db4ca70442',
7 months ago
),
'symfony/polyfill-php73' =>
array (
5 months ago
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => 'ec444d3f3f6505bb28d11afa41e75faadebc10a1',
7 months ago
),
'symfony/polyfill-php80' =>
array (
5 months ago
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433',
7 months ago
),
'symfony/process' =>
array (
6 months ago
'pretty_version' => 'v5.4.40',
'version' => '5.4.40.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'deedcb3bb4669cae2148bc920eafd2b16dc7c046',
7 months ago
),
'symfony/psr-http-message-bridge' =>
array (
6 months ago
'pretty_version' => 'v2.3.1',
'version' => '2.3.1.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '581ca6067eb62640de5ff08ee1ba6850a0ee472e',
7 months ago
),
'symfony/service-contracts' =>
array (
6 months ago
'pretty_version' => 'v2.5.3',
'version' => '2.5.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'a2329596ddc8fd568900e3fc76cba42489ecc7f3',
7 months ago
),
'symfony/translation' =>
array (
6 months ago
'pretty_version' => 'v5.4.40',
'version' => '5.4.40.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'bb51d7f183756d1ac03f50ea47dc5726518cc7e8',
7 months ago
),
'symfony/translation-contracts' =>
array (
6 months ago
'pretty_version' => 'v2.5.3',
'version' => '2.5.3.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'b0073a77ac0b7ea55131020e87b1e3af540f4664',
7 months ago
),
'symfony/translation-implementation' =>
array (
'provided' =>
array (
6 months ago
0 => '2.3',
7 months ago
),
),
'symfony/var-dumper' =>
array (
6 months ago
'pretty_version' => 'v4.4.47',
'version' => '4.4.47.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '1069c7a3fca74578022fab6f81643248d02f8e63',
7 months ago
),
'symfony/var-exporter' =>
array (
6 months ago
'pretty_version' => 'v5.4.40',
'version' => '5.4.40.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '6a13d37336d512927986e09f19a4bed24178baa6',
7 months ago
),
'topthink/framework' =>
array (
6 months ago
'pretty_version' => 'v6.1.4',
'version' => '6.1.4.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '66eb9cf4d627df12911344cd328faf9bb596bf2c',
7 months ago
),
'topthink/think' =>
array (
6 months ago
'pretty_version' => 'dev-master',
'version' => 'dev-master',
7 months ago
'aliases' =>
array (
),
5 months ago
'reference' => 'f1ed457e61fa36dc5b3d253f072677c61e8323fe',
7 months ago
),
'topthink/think-filesystem' =>
array (
6 months ago
'pretty_version' => 'v2.0.2',
'version' => '2.0.2.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => 'c08503232fcae0c3c7fefae5e6b5c841ffe09f2f',
7 months ago
),
'topthink/think-helper' =>
array (
'pretty_version' => 'v3.1.6',
'version' => '3.1.6.0',
'aliases' =>
array (
),
'reference' => '769acbe50a4274327162f9c68ec2e89a38eb2aff',
),
'topthink/think-multi-app' =>
array (
6 months ago
'pretty_version' => 'v1.0.17',
'version' => '1.0.17.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '4055a6187296ac16c0bc7bbab4ed5d92f82f791c',
7 months ago
),
'topthink/think-orm' =>
array (
6 months ago
'pretty_version' => 'v2.0.61',
'version' => '2.0.61.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '10528ebf4a5106b19c3bac9c6deae7a67ff49de6',
7 months ago
),
'topthink/think-queue' =>
array (
6 months ago
'pretty_version' => 'v3.0.9',
'version' => '3.0.9.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '654812b47dd7c708c4443deed27f212f8382e8da',
7 months ago
),
'topthink/think-worker' =>
array (
6 months ago
'pretty_version' => 'v3.0.7',
'version' => '3.0.7.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '9ba54333f337ee2c3f06054bb896bba9696d926c',
7 months ago
),
'wechatpay/wechatpay' =>
array (
6 months ago
'pretty_version' => '1.4.9',
'version' => '1.4.9.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '2cabc8a15136050c4ee61083cd24959114756a03',
7 months ago
),
'workerman/gateway-worker' =>
array (
'pretty_version' => 'v3.0.22',
'version' => '3.0.22.0',
'aliases' =>
array (
),
'reference' => 'a615036c482d11f68b693998575e804752ef9068',
),
'workerman/workerman' =>
array (
6 months ago
'pretty_version' => 'v3.5.35',
'version' => '3.5.35.0',
7 months ago
'aliases' =>
array (
),
6 months ago
'reference' => '3cc0adae51ba36db38b11e7996c64250d356dbe7',
7 months ago
),
'yiovo/tp6-cache' =>
array (
'pretty_version' => 'v1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => '31e0b5aaa1315ef85d7e68ed189bdb68406becfe',
),
'yiovo/tp6-captcha' =>
array (
'pretty_version' => 'v1.1.4',
'version' => '1.1.4.0',
'aliases' =>
array (
),
'reference' => 'ad04954c2c3de274f5bd7549788094ee96e4160e',
),
),
);
private static $canGetVendors;
private static $installedByVendor = array();
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
public static function isInstalled($packageName)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return true;
}
}
return false;
}
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)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
return self::$installed;
}
public static function getAllRawData()
{
return self::getInstalled();
}
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
}
}
}
$installed[] = self::$installed;
return $installed;
}
}