array ( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'aliases' => array ( ), 'reference' => 'f1ed457e61fa36dc5b3d253f072677c61e8323fe', 'name' => 'topthink/think', ), 'versions' => array ( 'adbario/php-dot-notation' => array ( 'pretty_version' => '2.5.0', 'version' => '2.5.0.0', 'aliases' => array ( ), 'reference' => '081e2cca50c84bfeeea2e3ef9b2c8d206d80ccae', ), 'aferrandini/phpqrcode' => array ( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', 'aliases' => array ( ), 'reference' => '3c1c0454d43710ab5bbe19a51ad4cb41c22e3d46', ), 'alibabacloud/tea' => array ( 'pretty_version' => '3.2.1', 'version' => '3.2.1.0', 'aliases' => array ( ), 'reference' => '1619cb96c158384f72b873e1f85de8b299c9c367', ), 'alibabacloud/tea-fileform' => array ( 'pretty_version' => '0.3.4', 'version' => '0.3.4.0', 'aliases' => array ( ), 'reference' => '4bf0c75a045c8115aa8cb1a394bd08d8bb833181', ), 'alipaysdk/easysdk' => array ( 'pretty_version' => '2.2.3', 'version' => '2.2.3.0', 'aliases' => array ( ), 'reference' => 'c6008839a22a5fca08e9f8536730f7abfed522d5', ), 'aliyuncs/oss-sdk-php' => array ( 'pretty_version' => 'v2.7.1', 'version' => '2.7.1.0', 'aliases' => array ( ), 'reference' => 'ce5d34dae9868237a32248788ea175c7e9da14b1', ), 'carbonphp/carbon-doctrine-types' => array ( 'pretty_version' => '2.1.0', 'version' => '2.1.0.0', 'aliases' => array ( ), 'reference' => '99f76ffa36cce3b70a4a6abce41dba15ca2e84cb', ), '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 ( 'pretty_version' => 'v8.14.0', 'version' => '8.14.0.0', 'aliases' => array ( ), 'reference' => 'bff3c3e2402f6a20449404637f91a5ae214eff46', ), 'ezyang/htmlpurifier' => array ( 'pretty_version' => 'v4.17.0', 'version' => '4.17.0.0', 'aliases' => array ( ), 'reference' => 'bbc513d79acf6691fa9cf10f192c90dd2957f18c', ), 'guzzlehttp/command' => array ( 'pretty_version' => '1.3.1', 'version' => '1.3.1.0', 'aliases' => array ( ), 'reference' => '0eebc653784f4902b3272e826fe8e88743d14e77', ), 'guzzlehttp/guzzle' => array ( 'pretty_version' => '7.8.1', 'version' => '7.8.1.0', 'aliases' => array ( ), 'reference' => '41042bc7ab002487b876a0683fc8dce04ddce104', ), 'guzzlehttp/guzzle-services' => array ( 'pretty_version' => '1.4.1', 'version' => '1.4.1.0', 'aliases' => array ( ), 'reference' => 'bcab7c0d61672b606510a6fe5af3039d04968c0f', ), 'guzzlehttp/promises' => array ( 'pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'aliases' => array ( ), 'reference' => 'bbff78d96034045e58e13dedd6ad91b5d1253223', ), 'guzzlehttp/psr7' => array ( 'pretty_version' => '2.6.2', 'version' => '2.6.2.0', 'aliases' => array ( ), 'reference' => '45b30f99ac27b5ca93cb4831afe16285f57b8221', ), 'guzzlehttp/uri-template' => array ( 'pretty_version' => 'v1.0.3', 'version' => '1.0.3.0', 'aliases' => array ( ), 'reference' => 'ecea8feef63bd4fef1f037ecb288386999ecc11c', ), 'huifurepo/dg-php-sdk' => array ( 'pretty_version' => '2.0.11', 'version' => '2.0.11.0', 'aliases' => array ( ), 'reference' => 'f9ba003fbc3c35e3e2ce7d0a1c05526f745dabdb', ), '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 ( 'pretty_version' => '1.15.0', 'version' => '1.15.0.0', 'aliases' => array ( ), 'reference' => 'ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301', ), 'lvht/geohash' => array ( 'pretty_version' => 'v1.1.0', 'version' => '1.1.0.0', 'aliases' => array ( ), 'reference' => 'bbba3e1b487f0ec2e5e666c1bc9d1d4277990a29', ), 'maennchen/zipstream-php' => array ( 'pretty_version' => '2.2.6', 'version' => '2.2.6.0', 'aliases' => array ( ), 'reference' => '30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f', ), 'markbaker/complex' => array ( 'pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'aliases' => array ( ), 'reference' => '95c56caa1cf5c766ad6d65b6344b807c1e8405b9', ), 'markbaker/matrix' => array ( 'pretty_version' => '3.0.1', 'version' => '3.0.1.0', 'aliases' => array ( ), 'reference' => '728434227fe21be27ff6d86621a1b13107a2562c', ), 'monolog/monolog' => array ( 'pretty_version' => '2.9.3', 'version' => '2.9.3.0', 'aliases' => array ( ), 'reference' => 'a30bfe2e142720dfa990d0a7e573997f5d884215', ), 'myclabs/php-enum' => array ( 'pretty_version' => '1.8.4', 'version' => '1.8.4.0', 'aliases' => array ( ), 'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483', ), 'nesbot/carbon' => array ( 'pretty_version' => '2.72.5', 'version' => '2.72.5.0', 'aliases' => array ( ), 'reference' => 'afd46589c216118ecd48ff2b95d77596af1e57ed', ), 'overtrue/easy-sms' => array ( 'pretty_version' => '2.7.1', 'version' => '2.7.1.0', 'aliases' => array ( ), 'reference' => 'd71d32f6631dda4c0da09c2831ff110a1c19873c', ), 'overtrue/socialite' => array ( 'pretty_version' => '3.5.5', 'version' => '3.5.5.0', 'aliases' => array ( ), 'reference' => '3cf32be7ae0fd86f83e41ca7239aa10e04b8b401', ), 'overtrue/wechat' => array ( 'pretty_version' => '5.35.1', 'version' => '5.35.1.0', 'aliases' => array ( ), 'reference' => '80059817ca5456d2efb4f1b2417aa1df72e0ec58', ), '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 ( 'pretty_version' => '1.29.0', 'version' => '1.29.0.0', 'aliases' => array ( ), 'reference' => 'fde2ccf55eaef7e86021ff1acce26479160a0fa0', ), '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', ), ), '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', ), ), '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 ( 'pretty_version' => '1.0.3', 'version' => '1.0.3.0', 'aliases' => array ( ), 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', ), 'psr/http-client-implementation' => array ( 'provided' => array ( 0 => '1.0', 1 => '*', ), ), 'psr/http-factory' => array ( 'pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'aliases' => array ( ), 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', ), 'psr/http-factory-implementation' => array ( 'provided' => array ( 0 => '1.0', 1 => '*', ), ), 'psr/http-message' => array ( 'pretty_version' => '1.1', 'version' => '1.1.0.0', 'aliases' => array ( ), 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', ), 'psr/http-message-implementation' => array ( 'provided' => array ( 0 => '1.0', 1 => '*', ), ), '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 ( 'pretty_version' => 'v2.6.11', 'version' => '2.6.11.0', 'aliases' => array ( ), 'reference' => '43a91c2d892888b670a9dac9744232f15e080a79', ), 'qiniu/php-sdk' => array ( 'pretty_version' => 'v7.12.1', 'version' => '7.12.1.0', 'aliases' => array ( ), 'reference' => '88952a65e97b4c2fae3f954bc4419ba14e42f154', ), 'ralouphie/getallheaders' => array ( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'aliases' => array ( ), 'reference' => '120b605dfeb996808c31b6477290a714d356e822', ), 'symfony/cache' => array ( 'pretty_version' => 'v5.4.40', 'version' => '5.4.40.0', 'aliases' => array ( ), 'reference' => '89005bc368ca02ed0433c592e4d27670d0844a66', ), 'symfony/cache-contracts' => array ( 'pretty_version' => 'v2.5.3', 'version' => '2.5.3.0', 'aliases' => array ( ), 'reference' => 'fee6db04d913094e2fb55ff8e7db5685a8134463', ), 'symfony/cache-implementation' => array ( 'provided' => array ( 0 => '1.0|2.0', ), ), 'symfony/deprecation-contracts' => array ( 'pretty_version' => 'v2.5.3', 'version' => '2.5.3.0', 'aliases' => array ( ), 'reference' => '80d075412b557d41002320b96a096ca65aa2c98d', ), 'symfony/event-dispatcher' => array ( 'pretty_version' => 'v5.4.40', 'version' => '5.4.40.0', 'aliases' => array ( ), 'reference' => 'a54e2a8a114065f31020d6a89ede83e34c3b27a4', ), 'symfony/event-dispatcher-contracts' => array ( 'pretty_version' => 'v2.5.3', 'version' => '2.5.3.0', 'aliases' => array ( ), 'reference' => '540f4c73e87fd0c71ca44a6aa305d024ac68cb73', ), 'symfony/event-dispatcher-implementation' => array ( 'provided' => array ( 0 => '2.0', ), ), 'symfony/http-foundation' => array ( 'pretty_version' => 'v5.4.40', 'version' => '5.4.40.0', 'aliases' => array ( ), 'reference' => 'cf4893ca4eca3fac4ae06da1590afdbbb4217847', ), 'symfony/polyfill-mbstring' => array ( 'pretty_version' => 'v1.30.0', 'version' => '1.30.0.0', 'aliases' => array ( ), 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', ), 'symfony/polyfill-php72' => array ( 'pretty_version' => 'v1.30.0', 'version' => '1.30.0.0', 'aliases' => array ( ), 'reference' => '10112722600777e02d2745716b70c5db4ca70442', ), 'symfony/polyfill-php73' => array ( 'pretty_version' => 'v1.30.0', 'version' => '1.30.0.0', 'aliases' => array ( ), 'reference' => 'ec444d3f3f6505bb28d11afa41e75faadebc10a1', ), 'symfony/polyfill-php80' => array ( 'pretty_version' => 'v1.30.0', 'version' => '1.30.0.0', 'aliases' => array ( ), 'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433', ), 'symfony/process' => array ( 'pretty_version' => 'v5.4.40', 'version' => '5.4.40.0', 'aliases' => array ( ), 'reference' => 'deedcb3bb4669cae2148bc920eafd2b16dc7c046', ), 'symfony/psr-http-message-bridge' => array ( 'pretty_version' => 'v2.3.1', 'version' => '2.3.1.0', 'aliases' => array ( ), 'reference' => '581ca6067eb62640de5ff08ee1ba6850a0ee472e', ), 'symfony/service-contracts' => array ( 'pretty_version' => 'v2.5.3', 'version' => '2.5.3.0', 'aliases' => array ( ), 'reference' => 'a2329596ddc8fd568900e3fc76cba42489ecc7f3', ), 'symfony/translation' => array ( 'pretty_version' => 'v5.4.40', 'version' => '5.4.40.0', 'aliases' => array ( ), 'reference' => 'bb51d7f183756d1ac03f50ea47dc5726518cc7e8', ), 'symfony/translation-contracts' => array ( 'pretty_version' => 'v2.5.3', 'version' => '2.5.3.0', 'aliases' => array ( ), 'reference' => 'b0073a77ac0b7ea55131020e87b1e3af540f4664', ), 'symfony/translation-implementation' => array ( 'provided' => array ( 0 => '2.3', ), ), 'symfony/var-dumper' => array ( 'pretty_version' => 'v4.4.47', 'version' => '4.4.47.0', 'aliases' => array ( ), 'reference' => '1069c7a3fca74578022fab6f81643248d02f8e63', ), 'symfony/var-exporter' => array ( 'pretty_version' => 'v5.4.40', 'version' => '5.4.40.0', 'aliases' => array ( ), 'reference' => '6a13d37336d512927986e09f19a4bed24178baa6', ), 'topthink/framework' => array ( 'pretty_version' => 'v6.1.4', 'version' => '6.1.4.0', 'aliases' => array ( ), 'reference' => '66eb9cf4d627df12911344cd328faf9bb596bf2c', ), 'topthink/think' => array ( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'aliases' => array ( ), 'reference' => 'f1ed457e61fa36dc5b3d253f072677c61e8323fe', ), 'topthink/think-filesystem' => array ( 'pretty_version' => 'v2.0.2', 'version' => '2.0.2.0', 'aliases' => array ( ), 'reference' => 'c08503232fcae0c3c7fefae5e6b5c841ffe09f2f', ), 'topthink/think-helper' => array ( 'pretty_version' => 'v3.1.6', 'version' => '3.1.6.0', 'aliases' => array ( ), 'reference' => '769acbe50a4274327162f9c68ec2e89a38eb2aff', ), 'topthink/think-multi-app' => array ( 'pretty_version' => 'v1.0.17', 'version' => '1.0.17.0', 'aliases' => array ( ), 'reference' => '4055a6187296ac16c0bc7bbab4ed5d92f82f791c', ), 'topthink/think-orm' => array ( 'pretty_version' => 'v2.0.61', 'version' => '2.0.61.0', 'aliases' => array ( ), 'reference' => '10528ebf4a5106b19c3bac9c6deae7a67ff49de6', ), 'topthink/think-queue' => array ( 'pretty_version' => 'v3.0.9', 'version' => '3.0.9.0', 'aliases' => array ( ), 'reference' => '654812b47dd7c708c4443deed27f212f8382e8da', ), 'topthink/think-worker' => array ( 'pretty_version' => 'v3.0.7', 'version' => '3.0.7.0', 'aliases' => array ( ), 'reference' => '9ba54333f337ee2c3f06054bb896bba9696d926c', ), 'wechatpay/wechatpay' => array ( 'pretty_version' => '1.4.9', 'version' => '1.4.9.0', 'aliases' => array ( ), 'reference' => '2cabc8a15136050c4ee61083cd24959114756a03', ), 'workerman/gateway-worker' => array ( 'pretty_version' => 'v3.0.22', 'version' => '3.0.22.0', 'aliases' => array ( ), 'reference' => 'a615036c482d11f68b693998575e804752ef9068', ), 'workerman/workerman' => array ( 'pretty_version' => 'v3.5.35', 'version' => '3.5.35.0', 'aliases' => array ( ), 'reference' => '3cc0adae51ba36db38b11e7996c64250d356dbe7', ), '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; } }