Update batching to install plugin deps before the plugin (alone an own batch)
parent
ee58f25c00
commit
aea074308c
|
@ -95,7 +95,7 @@ abstract class ArchiveDownloader extends FileDownloader
|
|||
$filesystem->unlink($fileName);
|
||||
|
||||
/**
|
||||
* Returns the folder content, excluding dotfiles
|
||||
* Returns the folder content, excluding .DS_Store
|
||||
*
|
||||
* @param string $dir Directory
|
||||
* @return \SplFileInfo[]
|
||||
|
|
|
@ -283,20 +283,31 @@ class InstallationManager
|
|||
|
||||
// execute operations in batches to make sure every plugin is installed in the
|
||||
// right order and activated before the packages depending on it are installed
|
||||
while ($operations) {
|
||||
$batches = array();
|
||||
$batch = array();
|
||||
|
||||
foreach ($operations as $index => $operation) {
|
||||
unset($operations[$index]);
|
||||
$batch[$index] = $operation;
|
||||
if (in_array($operation->getOperationType(), array('update', 'install'), true)) {
|
||||
$package = $operation->getOperationType() === 'update' ? $operation->getTargetPackage() : $operation->getPackage();
|
||||
if ($package->getType() === 'composer-plugin' || $package->getType() === 'composer-installer') {
|
||||
break;
|
||||
if ($batch) {
|
||||
$batches[] = $batch;
|
||||
}
|
||||
unset($operations[$index]);
|
||||
$batches[] = array($index => $operation);
|
||||
$batch = array();
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
unset($operations[$index]);
|
||||
$batch[$index] = $operation;
|
||||
}
|
||||
|
||||
if ($batch) {
|
||||
$batches[] = $batch;
|
||||
}
|
||||
|
||||
foreach ($batches as $batch) {
|
||||
$this->executeBatch($repo, $batch, $cleanupPromises, $devMode, $runScripts);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
|
Loading…
Reference in New Issue