diff --git a/composer/composer/InstalledVersions.php b/composer/composer/InstalledVersions.php index 51e734a774b..07b32ed6ef7 100644 --- a/composer/composer/InstalledVersions.php +++ b/composer/composer/InstalledVersions.php @@ -322,6 +322,7 @@ private static function getInstalled() } $installed = array(); + $copiedLocalDir = false; if (self::$canGetVendors) { foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { @@ -330,9 +331,11 @@ private static function getInstalled() } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @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} $required */ $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; } } } @@ -350,7 +353,7 @@ private static function getInstalled() } } - if (self::$installed !== array()) { + if (self::$installed !== array() && !$copiedLocalDir) { $installed[] = self::$installed; } diff --git a/composer/composer/installed.php b/composer/composer/installed.php index 47c190be46a..bb0e7a1a009 100644 --- a/composer/composer/installed.php +++ b/composer/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '00b8b908ec601f3541533afb5f8addc06038423e', + 'reference' => 'ee3d8b90a4886b0ca38bbc3f89b4808426726066', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '00b8b908ec601f3541533afb5f8addc06038423e', + 'reference' => 'ee3d8b90a4886b0ca38bbc3f89b4808426726066', 'type' => 'library', 'install_path' => __DIR__ . '/../', 'aliases' => array(),