array ( 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'aliases' => array ( ), 'reference' => 'a03cf1545863f33c9d8b97194f41f65c5fcf6c36', 'name' => 'topthink/think', ), 'versions' => array ( 'adbario/php-dot-notation' => array ( 'pretty_version' => '2.2.0', 'version' => '2.2.0.0', 'aliases' => array ( ), 'reference' => 'eee4fc81296531e6aafba4c2bbccfc5adab1676e', ), 'aferrandini/phpqrcode' => array ( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', 'aliases' => array ( ), 'reference' => '3c1c0454d43710ab5bbe19a51ad4cb41c22e3d46', ), 'alibabacloud/tea' => array ( 'pretty_version' => '3.1.23', 'version' => '3.1.23.0', 'aliases' => array ( ), 'reference' => '61fce993274edf6e7131af07256ed7723d97a85f', ), '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.1', 'version' => '2.2.1.0', 'aliases' => array ( ), 'reference' => '066388d02c6f55fe0919d75b386456d80801fec2', ), 'aliyuncs/oss-sdk-php' => array ( 'pretty_version' => 'v2.4.3', 'version' => '2.4.3.0', 'aliases' => array ( ), 'reference' => '4ccead614915ee6685bf30016afb01aabd347e46', ), 'danielstjules/stringy' => array ( 'pretty_version' => '3.1.0', 'version' => '3.1.0.0', 'aliases' => array ( ), 'reference' => 'df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e', ), '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.6.0', 'version' => '8.6.0.0', 'aliases' => array ( ), 'reference' => '03b145a3fd1dc984d7c2c79638c9257b1a17f8b7', ), 'ezyang/htmlpurifier' => array ( 'pretty_version' => 'v4.14.0', 'version' => '4.14.0.0', 'aliases' => array ( ), 'reference' => '12ab42bd6e742c70c0a52f7b82477fcd44e64b75', ), 'guzzlehttp/command' => array ( 'pretty_version' => '1.2.2', 'version' => '1.2.2.0', 'aliases' => array ( ), 'reference' => '7883359e0ecab8a8f7c43aad2fc36360a35d21e8', ), 'guzzlehttp/guzzle' => array ( 'pretty_version' => '7.4.2', 'version' => '7.4.2.0', 'aliases' => array ( ), 'reference' => 'ac1ec1cd9b5624694c3a40be801d94137afb12b4', ), 'guzzlehttp/guzzle-services' => array ( 'pretty_version' => '1.3.2', 'version' => '1.3.2.0', 'aliases' => array ( ), 'reference' => '4989d902dd4e0411b320e851c46f3c94d652d891', ), 'guzzlehttp/promises' => array ( 'pretty_version' => '1.5.1', 'version' => '1.5.1.0', 'aliases' => array ( ), 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', ), 'guzzlehttp/psr7' => array ( 'pretty_version' => '2.2.1', 'version' => '2.2.1.0', 'aliases' => array ( ), 'reference' => 'c94a94f120803a18554c1805ef2e539f8285f9a2', ), 'guzzlehttp/uri-template' => array ( 'pretty_version' => 'v1.0.1', 'version' => '1.0.1.0', 'aliases' => array ( ), 'reference' => 'b945d74a55a25a949158444f09ec0d3c120d69e2', ), '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.11.0', 'version' => '1.11.0.0', 'aliases' => array ( ), 'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd', ), 'lvht/geohash' => array ( 'pretty_version' => 'v1.1.0', 'version' => '1.1.0.0', 'aliases' => array ( ), 'reference' => 'bbba3e1b487f0ec2e5e666c1bc9d1d4277990a29', ), 'maennchen/zipstream-php' => array ( 'pretty_version' => '2.1.0', 'version' => '2.1.0.0', 'aliases' => array ( ), 'reference' => 'c4c5803cc1f93df3d2448478ef79394a5981cc58', ), 'markbaker/complex' => array ( 'pretty_version' => '3.0.1', 'version' => '3.0.1.0', 'aliases' => array ( ), 'reference' => 'ab8bc271e404909db09ff2d5ffa1e538085c0f22', ), 'markbaker/matrix' => array ( 'pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'aliases' => array ( ), 'reference' => 'c66aefcafb4f6c269510e9ac46b82619a904c576', ), 'monolog/monolog' => array ( 'pretty_version' => '2.5.0', 'version' => '2.5.0.0', 'aliases' => array ( ), 'reference' => '4192345e260f1d51b365536199744b987e160edc', ), 'mtdowling/jmespath.php' => array ( 'pretty_version' => '2.6.1', 'version' => '2.6.1.0', 'aliases' => array ( ), 'reference' => '9b87907a81b87bc76d19a7fb2d61e61486ee9edb', ), 'myclabs/php-enum' => array ( 'pretty_version' => '1.6.6', 'version' => '1.6.6.0', 'aliases' => array ( ), 'reference' => '32c4202886c51fbe5cc3a7c34ec5c9a4a790345e', ), 'nesbot/carbon' => array ( 'pretty_version' => '2.66.0', 'version' => '2.66.0.0', 'aliases' => array ( ), 'reference' => '496712849902241f04902033b0441b269effe001', ), 'overtrue/easy-sms' => array ( 'pretty_version' => '2.2.0', 'version' => '2.2.0.0', 'aliases' => array ( ), 'reference' => 'fda1b6fcde861451ccf54e1071b4e1877455d89a', ), 'overtrue/socialite' => array ( 'pretty_version' => '2.0.24', 'version' => '2.0.24.0', 'aliases' => array ( ), 'reference' => 'ee7e7b000ec7d64f2b8aba1f6a2eec5cdf3f8bec', ), 'overtrue/wechat' => array ( 'pretty_version' => '4.5.0', 'version' => '4.5.0.0', 'aliases' => array ( ), 'reference' => '04a940f97d6812a67bb8d5f2dbaebf9ad78ae776', ), '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.22.0', 'version' => '1.22.0.0', 'aliases' => array ( ), 'reference' => '3a9e29b4f386a08a151a33578e80ef1747037a48', ), '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/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.1', 'version' => '1.0.1.0', 'aliases' => array ( ), 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', ), 'psr/http-client-implementation' => array ( 'provided' => array ( 0 => '1.0', 1 => '*', ), ), 'psr/http-factory' => array ( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', 'aliases' => array ( ), 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', ), 'psr/http-factory-implementation' => array ( 'provided' => array ( 0 => '1.0', 1 => '*', ), ), 'psr/http-message' => array ( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', 'aliases' => array ( ), 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', ), '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.5.2', 'version' => '2.5.2.0', 'aliases' => array ( ), 'reference' => '3b2f32efd6c7bba7b982b118c5af18db74658fc5', ), 'qiniu/php-sdk' => array ( 'pretty_version' => 'v7.4.3', 'version' => '7.4.3.0', 'aliases' => array ( ), 'reference' => 'ee5344f319dd7babd86c9a38e6bd05aa58dc90ea', ), 'ralouphie/getallheaders' => array ( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'aliases' => array ( ), 'reference' => '120b605dfeb996808c31b6477290a714d356e822', ), 'songshenzong/support' => array ( 'pretty_version' => '2.0.6', 'version' => '2.0.6.0', 'aliases' => array ( ), 'reference' => 'b334d8abc99e8a85538a556e10c670c18b71c230', ), 'symfony/cache' => array ( 'pretty_version' => 'v5.4.7', 'version' => '5.4.7.0', 'aliases' => array ( ), 'reference' => 'ba06841ed293fcaf79a592f59fdaba471f7c756c', ), 'symfony/cache-contracts' => array ( 'pretty_version' => 'v2.5.1', 'version' => '2.5.1.0', 'aliases' => array ( ), 'reference' => '64be4a7acb83b6f2bf6de9a02cee6dad41277ebc', ), 'symfony/cache-implementation' => array ( 'provided' => array ( 0 => '1.0|2.0', ), ), 'symfony/deprecation-contracts' => array ( 'pretty_version' => 'v3.0.1', 'version' => '3.0.1.0', 'aliases' => array ( ), 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', ), 'symfony/event-dispatcher' => array ( 'pretty_version' => 'v5.4.3', 'version' => '5.4.3.0', 'aliases' => array ( ), 'reference' => 'dec8a9f58d20df252b9cd89f1c6c1530f747685d', ), 'symfony/event-dispatcher-contracts' => array ( 'pretty_version' => 'v3.0.1', 'version' => '3.0.1.0', 'aliases' => array ( ), 'reference' => '7bc61cc2db649b4637d331240c5346dcc7708051', ), 'symfony/event-dispatcher-implementation' => array ( 'provided' => array ( 0 => '2.0', ), ), 'symfony/http-foundation' => array ( 'pretty_version' => 'v5.4.6', 'version' => '5.4.6.0', 'aliases' => array ( ), 'reference' => '34e89bc147633c0f9dd6caaaf56da3b806a21465', ), 'symfony/polyfill-mbstring' => array ( 'pretty_version' => 'v1.25.0', 'version' => '1.25.0.0', 'aliases' => array ( ), 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', ), 'symfony/polyfill-php72' => array ( 'pretty_version' => 'v1.25.0', 'version' => '1.25.0.0', 'aliases' => array ( ), 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', ), 'symfony/polyfill-php73' => array ( 'pretty_version' => 'v1.25.0', 'version' => '1.25.0.0', 'aliases' => array ( ), 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5', ), 'symfony/polyfill-php80' => array ( 'pretty_version' => 'v1.25.0', 'version' => '1.25.0.0', 'aliases' => array ( ), 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', ), 'symfony/process' => array ( 'pretty_version' => 'v4.4.44', 'version' => '4.4.44.0', 'aliases' => array ( ), 'reference' => '5cee9cdc4f7805e2699d9fd66991a0e6df8252a2', ), 'symfony/psr-http-message-bridge' => array ( 'pretty_version' => 'v2.1.2', 'version' => '2.1.2.0', 'aliases' => array ( ), 'reference' => '22b37c8a3f6b5d94e9cdbd88e1270d96e2f97b34', ), 'symfony/service-contracts' => array ( 'pretty_version' => 'v2.5.1', 'version' => '2.5.1.0', 'aliases' => array ( ), 'reference' => '24d9dc654b83e91aa59f9d167b131bc3b5bea24c', ), 'symfony/translation' => array ( 'pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'aliases' => array ( ), 'reference' => '60556925a703cfbc1581cde3b3f35b0bb0ea904c', ), 'symfony/translation-contracts' => array ( 'pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'aliases' => array ( ), 'reference' => '68cce71402305a015f8c1589bfada1280dc64fe7', ), 'symfony/translation-implementation' => array ( 'provided' => array ( 0 => '2.3|3.0', ), ), 'symfony/var-dumper' => array ( 'pretty_version' => 'v4.4.39', 'version' => '4.4.39.0', 'aliases' => array ( ), 'reference' => '35237c5e5dcb6593a46a860ba5b29c1d4683d80e', ), 'symfony/var-exporter' => array ( 'pretty_version' => 'v6.0.7', 'version' => '6.0.7.0', 'aliases' => array ( ), 'reference' => '5f1fddb1b3a8394dbfb234044e3ad620a26e1735', ), 'topthink/framework' => array ( 'pretty_version' => 'v6.1.2', 'version' => '6.1.2.0', 'aliases' => array ( ), 'reference' => '67235be5b919aaaf1de5aed9839f65d8e766aca3', ), 'topthink/think' => array ( 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'aliases' => array ( ), 'reference' => 'a03cf1545863f33c9d8b97194f41f65c5fcf6c36', ), 'topthink/think-filesystem' => array ( 'pretty_version' => 'v2.0.1', 'version' => '2.0.1.0', 'aliases' => array ( ), 'reference' => '50af34c4cfc9a5cbe8a5e3ac9f4e2aa0fd90693f', ), '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.14', 'version' => '1.0.14.0', 'aliases' => array ( ), 'reference' => 'ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3', ), 'topthink/think-orm' => array ( 'pretty_version' => 'v2.0.53', 'version' => '2.0.53.0', 'aliases' => array ( ), 'reference' => '06783eda65547a70ea686360a897759e1f873fff', ), 'topthink/think-queue' => array ( 'pretty_version' => 'v3.0.7', 'version' => '3.0.7.0', 'aliases' => array ( ), 'reference' => 'cded7616e313f9daa55c0ad0de5791f0d1fb3066', ), 'topthink/think-worker' => array ( 'pretty_version' => 'v3.0.6', 'version' => '3.0.6.0', 'aliases' => array ( ), 'reference' => '21dc442aaa50594466ed3ed767af0a68b8b75364', ), 'wechatpay/wechatpay' => array ( 'pretty_version' => '1.4.6', 'version' => '1.4.6.0', 'aliases' => array ( ), 'reference' => 'edbdb6bb19e0818b0576043b265ff1b1e188d668', ), '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.31', 'version' => '3.5.31.0', 'aliases' => array ( ), 'reference' => 'b73ddc45b3c7299f330923a2bde23ca6e974fd96', ), 'xin/container' => array ( 'pretty_version' => '2.0.1', 'version' => '2.0.1.0', 'aliases' => array ( ), 'reference' => '97bb67f87dd851545938a1f2fe0ffbd379e3ff81', ), 'xin/helper' => array ( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'aliases' => array ( ), 'reference' => '02a58132dae2aea2d1c0b8e66f55125969224747', ), '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; } }