Skip to content

Commit 63fdd79

Browse files
bug #906 Fix compat with old composer versions (nicolas-grekas)
This PR was merged into the 1.x branch. Discussion ---------- Fix compat with old composer versions Fix #893 Commits ------- 01c41aa Fix compat with old composer versions
2 parents ec578e9 + 01c41aa commit 63fdd79

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Command/UnpackCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
110110
->setDumpAutoloader(false)
111111
->setIgnorePlatformRequirements(true)
112112
->setUpdate(true)
113-
->setUpdateAllowList(['php'])
114113
;
115114

115+
if (method_exists($installer, 'setUpdateAllowList')) {
116+
$installer->setUpdateAllowList(['php']);
117+
} else {
118+
$installer->setUpdateWhiteList(['php']);
119+
}
120+
116121
if (method_exists($composer->getEventDispatcher(), 'setRunScripts')) {
117122
$composer->getEventDispatcher()->setRunScripts(false);
118123
} else {

src/Flex.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,8 +1013,10 @@ private function reinstall(Event $event, bool $update)
10131013
$composer->getAutoloadGenerator()
10141014
);
10151015

1016-
if (!$update) {
1016+
if (!$update && method_exists($installer, 'setUpdateAllowList')) {
10171017
$installer->setUpdateAllowList(['php']);
1018+
} elseif (!$update) {
1019+
$installer->setUpdateWhiteList(['php']);
10181020
}
10191021

10201022
if (method_exists($installer, 'setSkipSuggest')) {

0 commit comments

Comments
 (0)