@@ -172,7 +172,6 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
172
172
}
173
173
174
174
if (isset (self ::$ aliasResolveCommands [$ command ])) {
175
- // early resolve for BC with Composer 1.0
176
175
if ($ input ->hasArgument ('packages ' )) {
177
176
$ input ->setArgument ('packages ' , $ resolver ->resolve ($ input ->getArgument ('packages ' ), self ::$ aliasResolveCommands [$ command ]));
178
177
}
@@ -185,9 +184,6 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
185
184
BasePackage::$ stabilities ['dev ' ] = 1 + BasePackage::STABILITY_STABLE ;
186
185
}
187
186
188
- $ app ->add (new Command \RequireCommand ($ resolver , \Closure::fromCallable ([$ this , 'updateComposerLock ' ])));
189
- $ app ->add (new Command \UpdateCommand ($ resolver ));
190
- $ app ->add (new Command \RemoveCommand ($ resolver ));
191
187
$ app ->add (new Command \RecipesCommand ($ this , $ this ->lock , $ rfs ));
192
188
$ app ->add (new Command \InstallRecipesCommand ($ this , $ this ->options ->get ('root-dir ' ), $ this ->options ->get ('runtime ' )['dotenv_path ' ] ?? '.env ' ));
193
189
$ app ->add (new Command \UpdateRecipesCommand ($ this , $ this ->downloader , $ rfs , $ this ->configurator , $ this ->options ->get ('root-dir ' )));
@@ -208,6 +204,14 @@ public function configureInstaller()
208
204
foreach ($ backtrace as $ trace ) {
209
205
if (isset ($ trace ['object ' ]) && $ trace ['object ' ] instanceof Installer) {
210
206
$ this ->installer = $ trace ['object ' ]->setSuggestedPackagesReporter (new SuggestedPackagesReporter (new NullIO ()));
207
+
208
+ $ updateAllowList = \Closure::bind (function () {
209
+ return $ this ->updateWhitelist ?? $ this ->updateAllowList ;
210
+ }, $ this ->installer , $ this ->installer )();
211
+
212
+ if (['php ' => 0 ] === $ updateAllowList ) {
213
+ $ this ->dryRun = true ; // prevent recipes from being uninstalled when removing a pack
214
+ }
211
215
}
212
216
213
217
if (isset ($ trace ['object ' ]) && $ trace ['object ' ] instanceof GlobalCommand) {
@@ -313,6 +317,9 @@ public function update(Event $event, $operations = [])
313
317
if (!isset ($ json ['flex- ' .$ type ])) {
314
318
continue ;
315
319
}
320
+
321
+ $ this ->io ->writeError (sprintf ('<warning>Using section "flex-%s" in composer.json is deprecated, use "%1$s" instead.</> ' , $ type ));
322
+
316
323
foreach ($ json ['flex- ' .$ type ] as $ package => $ constraint ) {
317
324
if ($ symfonyVersion && '* ' === $ constraint && isset ($ versions ['splits ' ][$ package ])) {
318
325
// replace unbounded constraints for symfony/* packages by extra.symfony.require
@@ -538,6 +545,7 @@ public function fetchRecipes(array $operations, bool $reset): array
538
545
$ recipes = [
539
546
'symfony/framework-bundle ' => null ,
540
547
];
548
+ $ packRecipes = [];
541
549
$ metaRecipes = [];
542
550
543
551
foreach ($ operations as $ operation ) {
@@ -587,12 +595,16 @@ public function fetchRecipes(array $operations, bool $reset): array
587
595
}
588
596
589
597
if (isset ($ manifests [$ name ])) {
590
- if ('metapackage ' === $ package ->getType ()) {
591
- $ metaRecipes [$ name ] = new Recipe ($ package , $ name , $ job , $ manifests [$ name ], $ locks [$ name ] ?? []);
598
+ $ recipe = new Recipe ($ package , $ name , $ job , $ manifests [$ name ], $ locks [$ name ] ?? []);
599
+
600
+ if ('symfony-pack ' === $ package ->getType ()) {
601
+ $ packRecipes [$ name ] = $ recipe ;
602
+ } elseif ('metapackage ' === $ package ->getType ()) {
603
+ $ metaRecipes [$ name ] = $ recipe ;
592
604
} elseif ('symfony/flex ' === $ name ) {
593
- $ flexRecipe = [$ name => new Recipe ( $ package , $ name , $ job , $ manifests [ $ name ], $ locks [ $ name ] ?? []) ];
605
+ $ flexRecipe = [$ name => $ recipe ];
594
606
} else {
595
- $ recipes [$ name ] = new Recipe ( $ package , $ name , $ job , $ manifests [ $ name ], $ locks [ $ name ] ?? []) ;
607
+ $ recipes [$ name ] = $ recipe ;
596
608
}
597
609
}
598
610
@@ -618,7 +630,7 @@ public function fetchRecipes(array $operations, bool $reset): array
618
630
}
619
631
}
620
632
621
- return array_merge ($ flexRecipe , $ metaRecipes , array_filter ($ recipes ));
633
+ return array_merge ($ flexRecipe , $ packRecipes , $ metaRecipes , array_filter ($ recipes ));
622
634
}
623
635
624
636
public function truncatePackages (PrePoolCreateEvent $ event )
0 commit comments