Skip to content

Commit

Permalink
Fix flex-rebooted dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jun 27, 2019
1 parent 38df7b4 commit 20951ca
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,34 @@ public function update(Event $event = null, $operations = [])
$composer->getDownloadManager()->setOutputProgress($this->progress);

$installer = \Closure::bind(function () use ($composer, &$devMode) {
return Installer::create($this->io, $composer)
$installer = Installer::create($this->io, $composer)
->setPreferSource($this->preferSource)
->setPreferDist($this->preferDist)
->setPreferStable($this->preferStable)
->setPreferLowest($this->preferLowest)
->setDevMode($devMode = $this->devMode)
->setIgnorePlatformRequirements($this->ignorePlatformReqs)
->setSuggestedPackagesReporter($this->suggestedPackagesReporter)
->setOptimizeAutoloader($this->optimizeAutoloader)
->setClassMapAuthoritative($this->classMapAuthoritative)
->setVerbose($this->verbose)
->setUpdate(true);

$extraProperties = [
'apcuAutoloader',
'skipSuggest',
'updateWhitelist',
'whitelistAllDependencies',
'whitelistDependencies',
'whitelistTransitiveDependencies',
];
foreach ($extraProperties as $property) {
if (property_exists($installer, $property)) {
$installer->{$property} = $this->{$property};
}
}

return $installer;
}, $this->installer, $this->installer)();

$composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $devMode);
Expand Down

0 comments on commit 20951ca

Please sign in to comment.