<?php
namespace Composer;
use Composer\Semver\VersionParser;
class InstalledVersions
{
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => NULL,
'name' => 'johncms/johncms',
),
'versions' =>
array (
'aura/autoload' =>
array (
'pretty_version' => '2.0.4',
'version' => '2.0.4.0',
'aliases' =>
array (
),
'reference' => '306a7f8d3cb58fb6f94bcff1dddf20c543f68668',
),
'brick/varexporter' =>
array (
'pretty_version' => '0.3.3',
'version' => '0.3.3.0',
'aliases' =>
array (
),
'reference' => '736378d357a189a692390bbc9e0eed835b079805',
),
'container-interop/container-interop' =>
array (
'pretty_version' => '1.2.0',
'version' => '1.2.0.0',
'aliases' =>
array (
),
'reference' => '79cbf1341c22ec75643d841642dd5d6acd83bdb8',
),
'container-interop/container-interop-implementation' =>
array (
'provided' =>
array (
0 => '^1.2',
),
),
'doctrine/inflector' =>
array (
'pretty_version' => '2.0.3',
'version' => '2.0.3.0',
'aliases' =>
array (
),
'reference' => '9cf661f4eb38f7c881cac67c75ea9b00bf97b210',
),
'ezyang/htmlpurifier' =>
array (
'pretty_version' => 'v4.13.0',
'version' => '4.13.0.0',
'aliases' =>
array (
),
'reference' => '08e27c97e4c6ed02f37c5b2b20488046c8d90d75',
),
'gettext/translator' =>
array (
'pretty_version' => 'v1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => '0a80844789e6a4ffad417d2053bbb56c83b02803',
),
'guzzlehttp/psr7' =>
array (
'pretty_version' => '1.7.0',
'version' => '1.7.0.0',
'aliases' =>
array (
),
'reference' => '53330f47520498c0ae1f61f7e2c90f55690c06a3',
),
'illuminate/cache' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '35dcb2c593ce95c85456da7b3a13e36ff460f535',
),
'illuminate/collections' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => 'fa1f5a2809a777040ab1616527dc2e66f4ae93f4',
),
'illuminate/container' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '657cac2aa601aa0223afe0ed8627d0cb443f6a22',
),
'illuminate/contracts' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '073109b521aec104f11c5cf5aded97aa0e63f313',
),
'illuminate/database' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '4a2040c25d28315be005784a9ea4c2efb2a95a27',
),
'illuminate/filesystem' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '2f468939ae97c861d683d35060e7ae0c11fdcb98',
),
'illuminate/macroable' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '300aa13c086f25116b5f3cde3ca54ff5c822fb05',
),
'illuminate/support' =>
array (
'pretty_version' => 'v8.22.1',
'version' => '8.22.1.0',
'aliases' =>
array (
),
'reference' => '6a516676a83d2a73c46eaf7907f730e86ef60da5',
),
'intervention/image' =>
array (
'pretty_version' => '2.5.1',
'version' => '2.5.1.0',
'aliases' =>
array (
),
'reference' => 'abbf18d5ab8367f96b3205ca3c89fb2fa598c69e',
),
'james-heinrich/getid3' =>
array (
'pretty_version' => 'v1.9.20',
'version' => '1.9.20.0',
'aliases' =>
array (
),
'reference' => '3c15e353b9bb1252201c73394bb8390b573a751d',
),
'johncms/johncms' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => NULL,
),
'laminas/laminas-config-aggregator' =>
array (
'pretty_version' => '1.4.0',
'version' => '1.4.0.0',
'aliases' =>
array (
),
'reference' => '1f26cc56ecf26009f1219f13ac5ecbf75394099f',
),
'laminas/laminas-escaper' =>
array (
'pretty_version' => '2.7.0',
'version' => '2.7.0.0',
'aliases' =>
array (
),
'reference' => '5e04bc5ae5990b17159d79d331055e2c645e5cc5',
),
'laminas/laminas-loader' =>
array (
'pretty_version' => '2.6.1',
'version' => '2.6.1.0',
'aliases' =>
array (
),
'reference' => '5d01c2c237ae9e68bec262f339947e2ea18979bc',
),
'laminas/laminas-mail' =>
array (
'pretty_version' => '2.12.5',
'version' => '2.12.5.0',
'aliases' =>
array (
),
'reference' => 'ed5b36a0deef4ffafe6138c2ae9cafcffafab856',
),
'laminas/laminas-mime' =>
array (
'pretty_version' => '2.7.4',
'version' => '2.7.4.0',
'aliases' =>
array (
),
'reference' => 'e45a7d856bf7b4a7b5bd00d6371f9961dc233add',
),
'laminas/laminas-servicemanager' =>
array (
'pretty_version' => '3.6.2',
'version' => '3.6.2.0',
'aliases' =>
array (
),
'reference' => '69a33802574e34357da6937602622a8a8db69883',
),
'laminas/laminas-stdlib' =>
array (
'pretty_version' => '3.3.1',
'version' => '3.3.1.0',
'aliases' =>
array (
),
'reference' => 'd81c7ffe602ed0e6ecb18691019111c0f4bf1efe',
),
'laminas/laminas-uri' =>
array (
'pretty_version' => '2.8.0',
'version' => '2.8.0.0',
'aliases' =>
array (
),
'reference' => '8651611b6285529f25a4cb9a466c686d9b31468e',
),
'laminas/laminas-validator' =>
array (
'pretty_version' => '2.14.0',
'version' => '2.14.0.0',
'aliases' =>
array (
),
'reference' => '8da5e20ed7b2b8101c1de68ca8dc0180210ed23e',
),
'laminas/laminas-zendframework-bridge' =>
array (
'pretty_version' => '1.1.1',
'version' => '1.1.1.0',
'aliases' =>
array (
),
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
),
'mobicms/captcha' =>
array (
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'aliases' =>
array (
),
'reference' => '529dd0ff11f13039e6ba0c3b8a1244e3319ac46b',
),
'mobicms/render' =>
array (
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'aliases' =>
array (
),
'reference' => '71dbc70cd3b1c834731f7490765d9e9f47029f50',
),
'nesbot/carbon' =>
array (
'pretty_version' => '2.43.0',
'version' => '2.43.0.0',
'aliases' =>
array (
),
'reference' => 'd32c57d8389113742f4a88725a170236470012e2',
),
'nikic/fast-route' =>
array (
'pretty_version' => 'v1.3.0',
'version' => '1.3.0.0',
'aliases' =>
array (
),
'reference' => '181d480e08d9476e61381e04a71b34dc0432e812',
),
'nikic/php-parser' =>
array (
'pretty_version' => 'v4.10.4',
'version' => '4.10.4.0',
'aliases' =>
array (
),
'reference' => 'c6d052fc58cb876152f89f532b95a8d7907e7f0e',
),
'psr/container' =>
array (
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f',
),
'psr/container-implementation' =>
array (
'provided' =>
array (
0 => '1.0',
1 => '^1.0',
),
),
'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',
),
),
'psr/log-implementation' =>
array (
'provided' =>
array (
0 => '1.0',
),
),
'psr/simple-cache' =>
array (
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'aliases' =>
array (
),
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
),
'ralouphie/getallheaders' =>
array (
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'aliases' =>
array (
),
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
),
'simba77/johncms-pagination' =>
array (
'pretty_version' => '1.1.2',
'version' => '1.1.2.0',
'aliases' =>
array (
),
'reference' => 'cfaa8e3b48dc42dbb8af751881af5d4bf93e2200',
),
'symfony/console' =>
array (
'pretty_version' => 'v5.2.1',
'version' => '5.2.1.0',
'aliases' =>
array (
),
'reference' => '47c02526c532fb381374dab26df05e7313978976',
),
'symfony/finder' =>
array (
'pretty_version' => 'v5.2.1',
'version' => '5.2.1.0',
'aliases' =>
array (
),
'reference' => '0b9231a5922fd7287ba5b411893c0ecd2733e5ba',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.22.0',
'version' => '1.22.0.0',
'aliases' =>
array (
),
'reference' => 'c6c942b1ac76c82448322025e084cadc56048b4e',
),
'symfony/polyfill-intl-grapheme' =>
array (
'pretty_version' => 'v1.22.0',
'version' => '1.22.0.0',
'aliases' =>
array (
),
'reference' => '267a9adeb8ecb8071040a740930e077cdfb987af',
),
'symfony/polyfill-intl-normalizer' =>
array (
'pretty_version' => 'v1.22.0',
'version' => '1.22.0.0',
'aliases' =>
array (
),
'reference' => '6e971c891537eb617a00bb07a43d182a6915faba',
),
'symfony/polyfill-mbstring' =>
array (
'pretty_version' => 'v1.22.0',
'version' => '1.22.0.0',
'aliases' =>
array (
),
'reference' => 'f377a3dd1fde44d37b9831d68dc8dea3ffd28e13',
),
'symfony/polyfill-php73' =>
array (
'pretty_version' => 'v1.22.0',
'version' => '1.22.0.0',
'aliases' =>
array (
),
'reference' => 'a678b42e92f86eca04b7fa4c0f6f19d097fb69e2',
),
'symfony/polyfill-php80' =>
array (
'pretty_version' => 'v1.22.0',
'version' => '1.22.0.0',
'aliases' =>
array (
),
'reference' => 'dc3063ba22c2a1fd2f45ed856374d79114998f91',
),
'symfony/service-contracts' =>
array (
'pretty_version' => 'v2.2.0',
'version' => '2.2.0.0',
'aliases' =>
array (
),
'reference' => 'd15da7ba4957ffb8f1747218be9e1a121fd298a1',
),
'symfony/string' =>
array (
'pretty_version' => 'v5.2.1',
'version' => '5.2.1.0',
'aliases' =>
array (
),
'reference' => '5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed',
),
'symfony/translation' =>
array (
'pretty_version' => 'v5.2.1',
'version' => '5.2.1.0',
'aliases' =>
array (
),
'reference' => 'a04209ba0d1391c828e5b2373181dac63c52ee70',
),
'symfony/translation-contracts' =>
array (
'pretty_version' => 'v2.3.0',
'version' => '2.3.0.0',
'aliases' =>
array (
),
'reference' => 'e2eaa60b558f26a4b0354e1bbb25636efaaad105',
),
'symfony/translation-implementation' =>
array (
'provided' =>
array (
0 => '2.0',
),
),
'true/punycode' =>
array (
'pretty_version' => 'v2.1.1',
'version' => '2.1.1.0',
'aliases' =>
array (
),
'reference' => 'a4d0c11a36dd7f4e7cd7096076cab6d3378a071e',
),
'voku/portable-ascii' =>
array (
'pretty_version' => '1.5.6',
'version' => '1.5.6.0',
'aliases' =>
array (
),
'reference' => '80953678b19901e5165c56752d087fc11526017c',
),
'webimpress/safe-writer' =>
array (
'pretty_version' => '2.1.0',
'version' => '2.1.0.0',
'aliases' =>
array (
),
'reference' => '5cfafdec5873c389036f14bf832a5efc9390dcdd',
),
'zendframework/zend-config-aggregator' =>
array (
'replaced' =>
array (
0 => '^1.2.0',
),
),
'zendframework/zend-escaper' =>
array (
'replaced' =>
array (
0 => '^2.6.1',
),
),
'zendframework/zend-loader' =>
array (
'replaced' =>
array (
0 => '2.6.1',
),
),
'zendframework/zend-mail' =>
array (
'replaced' =>
array (
0 => '^2.10.0',
),
),
'zendframework/zend-mime' =>
array (
'replaced' =>
array (
0 => '^2.7.2',
),
),
'zendframework/zend-servicemanager' =>
array (
'replaced' =>
array (
0 => '^3.4.0',
),
),
'zendframework/zend-stdlib' =>
array (
'replaced' =>
array (
0 => '^3.2.1',
),
),
'zendframework/zend-uri' =>
array (
'replaced' =>
array (
0 => '^2.7.1',
),
),
'zendframework/zend-validator' =>
array (
'replaced' =>
array (
0 => '^2.13.0',
),
),
),
);
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;
}
}