From 399fff8420e510c0f402cbd42d310d37de57d23c Mon Sep 17 00:00:00 2001 From: theofidry <5175937+theofidry@users.noreply.github.com> Date: Sun, 5 Jan 2025 11:00:36 +0000 Subject: [PATCH] Update the RequirementChecker --- .../vendor/composer/InstalledVersions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/res/requirement-checker/vendor/composer/InstalledVersions.php b/res/requirement-checker/vendor/composer/InstalledVersions.php index 2c3ddcc0..9322ca51 100644 --- a/res/requirement-checker/vendor/composer/InstalledVersions.php +++ b/res/requirement-checker/vendor/composer/InstalledVersions.php @@ -178,15 +178,18 @@ private static function getInstalled() self::$canGetVendors = method_exists('HumbugBox462\Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); } $installed = array(); + $copiedLocalDir = \false; 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')) { $required = require $vendorDir . '/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir . '/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; + self::$installedByVendor[$vendorDir] = $required; + $installed[] = $required; + if (strtr($vendorDir . '/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $required; + $copiedLocalDir = \true; } } } @@ -199,7 +202,7 @@ private static function getInstalled() self::$installed = array(); } } - if (self::$installed !== array()) { + if (self::$installed !== array() && !$copiedLocalDir) { $installed[] = self::$installed; } return $installed;