Skip to content

Commit

Permalink
feat: make sure the APCU autoloader prefix is deterministic when a `c…
Browse files Browse the repository at this point in the history
…omposer.lock` file is available
  • Loading branch information
drupol committed May 5, 2024
1 parent 2fe3244 commit 2d93816
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Composer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,12 @@ public function run(): int
}

$this->autoloadGenerator->setClassMapAuthoritative($this->classMapAuthoritative);
$this->autoloadGenerator->setApcu($this->apcuAutoloader, $this->apcuAutoloaderPrefix);
$this->autoloadGenerator->setApcu(
$this->apcuAutoloader,
$this->apcuAutoloaderPrefix === null
? ($this->locker !== null && $this->locker->isLocked() ? $this->locker->getLockData()['content-hash'] : md5(uniqid('', true)))
: $this->apcuAutoloaderPrefix
);
$this->autoloadGenerator->setRunScripts($this->runScripts);
$this->autoloadGenerator->setPlatformRequirementFilter($this->platformRequirementFilter);
$this
Expand Down

0 comments on commit 2d93816

Please sign in to comment.