diff --git a/composer.lock b/composer.lock index 7c668b9a..c8176714 100644 --- a/composer.lock +++ b/composer.lock @@ -1387,5 +1387,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } diff --git a/vendor/autoload.php b/vendor/autoload.php index d0f64c24..e834bf37 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,11 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + exit(1); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 247294d6..afef3fa2 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,30 +42,75 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var ?string */ private $vendorDir; // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ private static $registeredLoaders = array(); + /** + * @param ?string $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +120,47 @@ class ClassLoader return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,9 +175,11 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -156,11 +222,13 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,8 +272,10 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +290,12 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +315,8 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +339,8 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +361,8 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,6 +383,8 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { @@ -324,6 +404,8 @@ class ClassLoader /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -338,7 +420,7 @@ class ClassLoader * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { @@ -347,6 +429,8 @@ class ClassLoader return true; } + + return null; } /** @@ -401,6 +485,11 @@ class ClassLoader return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -472,6 +561,10 @@ class ClassLoader * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index cc4b22cf..c6b54af7 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -1,484 +1,352 @@ + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; - - - - - +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ class InstalledVersions { -private static $installed = array ( - 'root' => - array ( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'aliases' => - array ( - ), - 'reference' => '0ffe21fd25ad5261d9a9aad7202ba083a5afceb1', - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'aliases' => - array ( - ), - 'reference' => '0ffe21fd25ad5261d9a9aad7202ba083a5afceb1', - ), - 'composer/ca-bundle' => - array ( - 'pretty_version' => '1.3.3', - 'version' => '1.3.3.0', - 'aliases' => - array ( - ), - 'reference' => '30897edbfb15e784fe55587b4f73ceefd3c4d98c', - ), - 'embed/embed' => - array ( - 'pretty_version' => 'v4.4.6', - 'version' => '4.4.6.0', - 'aliases' => - array ( - ), - 'reference' => '9cb2dff5c82201bbf653b7396d533d1914ff4517', - ), - 'gettext/gettext' => - array ( - 'pretty_version' => 'v5.7.0', - 'version' => '5.7.0.0', - 'aliases' => - array ( - ), - 'reference' => '8657e580747bb3baacccdcebe69cac094661e404', - ), - 'gettext/languages' => - array ( - 'pretty_version' => '2.9.0', - 'version' => '2.9.0.0', - 'aliases' => - array ( - ), - 'reference' => 'ed56dd2c7f4024cc953ed180d25f02f2640e3ffa', - ), - 'gettext/translator' => - array ( - 'pretty_version' => 'v1.1.1', - 'version' => '1.1.1.0', - 'aliases' => - array ( - ), - 'reference' => 'b18ff33e8203de623854561f5e47e992fc5c50bb', - ), - 'grandel/include-directory' => - array ( - 'pretty_version' => 'v0.2.2', - 'version' => '0.2.2.0', - 'aliases' => - array ( - ), - 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', - ), - 'guzzlehttp/guzzle' => - array ( - 'pretty_version' => '7.5.0', - 'version' => '7.5.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba', - ), - 'guzzlehttp/promises' => - array ( - 'pretty_version' => '1.5.2', - 'version' => '1.5.2.0', - 'aliases' => - array ( - ), - 'reference' => 'b94b2807d85443f9719887892882d0329d1e2598', - ), - 'guzzlehttp/psr7' => - array ( - 'pretty_version' => '2.4.1', - 'version' => '2.4.1.0', - 'aliases' => - array ( - ), - 'reference' => '69568e4293f4fa993f3b0e51c9723e1e17c41379', - ), - 'ml/iri' => - array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'aliases' => - array ( - ), - 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', - ), - 'ml/json-ld' => - array ( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'aliases' => - array ( - ), - 'reference' => '537e68e87a6bce23e57c575cd5dcac1f67ce25d8', - ), - 'oscarotero/html-parser' => - array ( - 'pretty_version' => 'v0.1.6', - 'version' => '0.1.6.0', - 'aliases' => - array ( - ), - 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', - ), - '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', - ), - ), - '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', - ), - ), - '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', - ), - ), - 'qferr/mjml-php' => - array ( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'aliases' => - array ( - ), - 'reference' => 'c6ea36c190e304e399a957f7e03b5a378faf41b9', - ), - 'ralouphie/getallheaders' => - array ( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - ), - 'symfony/deprecation-contracts' => - array ( - 'pretty_version' => 'v3.1.1', - 'version' => '3.1.1.0', - 'aliases' => - array ( - ), - 'reference' => '07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918', - ), - 'symfony/polyfill-php80' => - array ( - 'pretty_version' => 'v1.26.0', - 'version' => '1.26.0.0', - 'aliases' => - array ( - ), - 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace', - ), - 'symfony/process' => - array ( - 'pretty_version' => 'v5.4.11', - 'version' => '5.4.11.0', - 'aliases' => - array ( - ), - 'reference' => '6e75fe6874cbc7e4773d049616ab450eff537bf1', - ), - ), -); -private static $canGetVendors; -private static $installedByVendor = array(); + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + /** + * @var bool|null + */ + private static $canGetVendors; + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + 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))); + } + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = 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() -{ -return self::$installed; -} - - - - - - - - - - - - - - - - - - - -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; -} + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + 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'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + 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'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + 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'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + 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'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + 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); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + 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'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index dc15c487..5490b88d 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 4c2fb35c..903d3d36 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,14 +2,14 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '09fc349b549513bf7f4291502426f919' => $vendorDir . '/embed/embed/src/functions.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 98a5e85d..c27b0518 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index bf0c502f..667533b2 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 56b5e75a..62ee69d0 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -25,38 +25,15 @@ class ComposerAutoloaderInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit5f3db9fc1d0cf1dd6a77a1d84501b4b1', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit5f3db9fc1d0cf1dd6a77a1d84501b4b1', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::getInitializer($loader)); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } + $includeFiles = \Composer\Autoload\ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1::$files; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire5f3db9fc1d0cf1dd6a77a1d84501b4b1($fileIdentifier, $file); } @@ -65,11 +42,16 @@ class ComposerAutoloaderInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire5f3db9fc1d0cf1dd6a77a1d84501b4b1($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index aca0a660..6f1c5a94 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,10 +7,10 @@ namespace Composer\Autoload; class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 { public static $files = array ( - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '09fc349b549513bf7f4291502426f919' => __DIR__ . '/..' . '/embed/embed/src/functions.php', ); diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 8ee41bfc..6d645dea 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,225 +1,221 @@ - - array ( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'aliases' => - array ( + array( + 'name' => '__root__', + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => 'dbac609620f0c637189d7d4806892a77ccef4a87', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, ), - 'reference' => '0ffe21fd25ad5261d9a9aad7202ba083a5afceb1', - 'name' => '__root__', - ), - 'versions' => - array ( - '__root__' => - array ( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'aliases' => - array ( - ), - 'reference' => '0ffe21fd25ad5261d9a9aad7202ba083a5afceb1', + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => 'dbac609620f0c637189d7d4806892a77ccef4a87', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'composer/ca-bundle' => array( + 'pretty_version' => '1.3.3', + 'version' => '1.3.3.0', + 'reference' => '30897edbfb15e784fe55587b4f73ceefd3c4d98c', + 'type' => 'library', + 'install_path' => __DIR__ . '/./ca-bundle', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'embed/embed' => array( + 'pretty_version' => 'v4.4.6', + 'version' => '4.4.6.0', + 'reference' => '9cb2dff5c82201bbf653b7396d533d1914ff4517', + 'type' => 'library', + 'install_path' => __DIR__ . '/../embed/embed', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'gettext/gettext' => array( + 'pretty_version' => 'v5.7.0', + 'version' => '5.7.0.0', + 'reference' => '8657e580747bb3baacccdcebe69cac094661e404', + 'type' => 'library', + 'install_path' => __DIR__ . '/../gettext/gettext', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'gettext/languages' => array( + 'pretty_version' => '2.9.0', + 'version' => '2.9.0.0', + 'reference' => 'ed56dd2c7f4024cc953ed180d25f02f2640e3ffa', + 'type' => 'library', + 'install_path' => __DIR__ . '/../gettext/languages', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'gettext/translator' => array( + 'pretty_version' => 'v1.1.1', + 'version' => '1.1.1.0', + 'reference' => 'b18ff33e8203de623854561f5e47e992fc5c50bb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../gettext/translator', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'grandel/include-directory' => array( + 'pretty_version' => 'v0.2.2', + 'version' => '0.2.2.0', + 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', + 'type' => 'library', + 'install_path' => __DIR__ . '/../grandel/include-directory', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '7.5.0', + 'version' => '7.5.0.0', + 'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '1.5.2', + 'version' => '1.5.2.0', + 'reference' => 'b94b2807d85443f9719887892882d0329d1e2598', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '2.4.1', + 'version' => '2.4.1.0', + 'reference' => '69568e4293f4fa993f3b0e51c9723e1e17c41379', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ml/iri' => array( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ml/iri/ML/IRI', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ml/json-ld' => array( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'reference' => '537e68e87a6bce23e57c575cd5dcac1f67ce25d8', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ml/json-ld', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'oscarotero/html-parser' => array( + 'pretty_version' => 'v0.1.6', + 'version' => '0.1.6.0', + 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', + 'type' => 'library', + 'install_path' => __DIR__ . '/../oscarotero/html-parser', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-factory' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-factory', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-message' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'qferr/mjml-php' => array( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => 'c6ea36c190e304e399a957f7e03b5a378faf41b9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../qferr/mjml-php', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.1.1', + 'version' => '3.1.1.0', + 'reference' => '07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.26.0', + 'version' => '1.26.0.0', + 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/process' => array( + 'pretty_version' => 'v5.4.11', + 'version' => '5.4.11.0', + 'reference' => '6e75fe6874cbc7e4773d049616ab450eff537bf1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/process', + 'aliases' => array(), + 'dev_requirement' => false, + ), ), - 'composer/ca-bundle' => - array ( - 'pretty_version' => '1.3.3', - 'version' => '1.3.3.0', - 'aliases' => - array ( - ), - 'reference' => '30897edbfb15e784fe55587b4f73ceefd3c4d98c', - ), - 'embed/embed' => - array ( - 'pretty_version' => 'v4.4.6', - 'version' => '4.4.6.0', - 'aliases' => - array ( - ), - 'reference' => '9cb2dff5c82201bbf653b7396d533d1914ff4517', - ), - 'gettext/gettext' => - array ( - 'pretty_version' => 'v5.7.0', - 'version' => '5.7.0.0', - 'aliases' => - array ( - ), - 'reference' => '8657e580747bb3baacccdcebe69cac094661e404', - ), - 'gettext/languages' => - array ( - 'pretty_version' => '2.9.0', - 'version' => '2.9.0.0', - 'aliases' => - array ( - ), - 'reference' => 'ed56dd2c7f4024cc953ed180d25f02f2640e3ffa', - ), - 'gettext/translator' => - array ( - 'pretty_version' => 'v1.1.1', - 'version' => '1.1.1.0', - 'aliases' => - array ( - ), - 'reference' => 'b18ff33e8203de623854561f5e47e992fc5c50bb', - ), - 'grandel/include-directory' => - array ( - 'pretty_version' => 'v0.2.2', - 'version' => '0.2.2.0', - 'aliases' => - array ( - ), - 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', - ), - 'guzzlehttp/guzzle' => - array ( - 'pretty_version' => '7.5.0', - 'version' => '7.5.0.0', - 'aliases' => - array ( - ), - 'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba', - ), - 'guzzlehttp/promises' => - array ( - 'pretty_version' => '1.5.2', - 'version' => '1.5.2.0', - 'aliases' => - array ( - ), - 'reference' => 'b94b2807d85443f9719887892882d0329d1e2598', - ), - 'guzzlehttp/psr7' => - array ( - 'pretty_version' => '2.4.1', - 'version' => '2.4.1.0', - 'aliases' => - array ( - ), - 'reference' => '69568e4293f4fa993f3b0e51c9723e1e17c41379', - ), - 'ml/iri' => - array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'aliases' => - array ( - ), - 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', - ), - 'ml/json-ld' => - array ( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'aliases' => - array ( - ), - 'reference' => '537e68e87a6bce23e57c575cd5dcac1f67ce25d8', - ), - 'oscarotero/html-parser' => - array ( - 'pretty_version' => 'v0.1.6', - 'version' => '0.1.6.0', - 'aliases' => - array ( - ), - 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', - ), - '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', - ), - ), - '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', - ), - ), - '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', - ), - ), - 'qferr/mjml-php' => - array ( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'aliases' => - array ( - ), - 'reference' => 'c6ea36c190e304e399a957f7e03b5a378faf41b9', - ), - 'ralouphie/getallheaders' => - array ( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'aliases' => - array ( - ), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - ), - 'symfony/deprecation-contracts' => - array ( - 'pretty_version' => 'v3.1.1', - 'version' => '3.1.1.0', - 'aliases' => - array ( - ), - 'reference' => '07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918', - ), - 'symfony/polyfill-php80' => - array ( - 'pretty_version' => 'v1.26.0', - 'version' => '1.26.0.0', - 'aliases' => - array ( - ), - 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace', - ), - 'symfony/process' => - array ( - 'pretty_version' => 'v5.4.11', - 'version' => '5.4.11.0', - 'aliases' => - array ( - ), - 'reference' => '6e75fe6874cbc7e4773d049616ab450eff537bf1', - ), - ), );