Skip to content

Commit

Permalink
Allows merge allow-plugins config
Browse files Browse the repository at this point in the history
  • Loading branch information
edersoares committed Feb 8, 2024
1 parent 2cc3819 commit ad3c2cb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Composer/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ private function loadComposerPackageFile(IOInterface $io, array &$plugged, array
unset($packagesConfig['prefer-stable']);
}

$allowPlugins = $packagesConfig['config']['allow-plugins'] ?? null;

if (is_bool($allowPlugins)) {
$localConfig['config']['allow-plugins'] = $allowPlugins;
unset($packagesConfig['config']['allow-plugins']);
}

if (is_array($allowPlugins)) {
foreach ($allowPlugins as $plugin => $allow) {
$localConfig['config']['allow-plugins'][$plugin] = $allow;
}
unset($packagesConfig['config']['allow-plugins']);
}

$localConfig = array_merge_recursive($localConfig, $packagesConfig);
}

Expand Down

0 comments on commit ad3c2cb

Please sign in to comment.