1
0
Fork 0

Fix type error when upgrading composer

pull/11353/head
Jordi Boggiano 2023-02-24 17:41:59 +01:00
parent 1ff942bb44
commit b5aad9ec0d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 2 deletions

View File

@ -163,9 +163,13 @@ class FilesystemRepository extends WritableArrayRepository
$this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', '<?php return ' . $this->dumpToPhpCode($versions) . ';'."\n");
$installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php');
$this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass);
\Composer\InstalledVersions::reload($versions);
// this normally should not happen but during upgrades of Composer when it is installed in the project it is a possibility
if ($installedVersionsClass !== false) {
$this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass);
\Composer\InstalledVersions::reload($versions);
}
}
}