@@ -172,7 +172,6 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
172172 }
173173
174174 if (isset (self ::$ aliasResolveCommands [$ command ])) {
175- // early resolve for BC with Composer 1.0
176175 if ($ input ->hasArgument ('packages ' )) {
177176 $ input ->setArgument ('packages ' , $ resolver ->resolve ($ input ->getArgument ('packages ' ), self ::$ aliasResolveCommands [$ command ]));
178177 }
@@ -185,9 +184,6 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
185184 BasePackage::$ stabilities ['dev ' ] = 1 + BasePackage::STABILITY_STABLE ;
186185 }
187186
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 ));
191187 $ app ->add (new Command \RecipesCommand ($ this , $ this ->lock , $ rfs ));
192188 $ app ->add (new Command \InstallRecipesCommand ($ this , $ this ->options ->get ('root-dir ' ), $ this ->options ->get ('runtime ' )['dotenv_path ' ] ?? '.env ' ));
193189 $ app ->add (new Command \UpdateRecipesCommand ($ this , $ this ->downloader , $ rfs , $ this ->configurator , $ this ->options ->get ('root-dir ' )));
@@ -208,6 +204,14 @@ public function configureInstaller()
208204 foreach ($ backtrace as $ trace ) {
209205 if (isset ($ trace ['object ' ]) && $ trace ['object ' ] instanceof Installer) {
210206 $ 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+ }
211215 }
212216
213217 if (isset ($ trace ['object ' ]) && $ trace ['object ' ] instanceof GlobalCommand) {
@@ -313,6 +317,9 @@ public function update(Event $event, $operations = [])
313317 if (!isset ($ json ['flex- ' .$ type ])) {
314318 continue ;
315319 }
320+
321+ $ this ->io ->writeError (sprintf ('<warning>Using section "flex-%s" in composer.json is deprecated, use "%1$s" instead.</> ' , $ type ));
322+
316323 foreach ($ json ['flex- ' .$ type ] as $ package => $ constraint ) {
317324 if ($ symfonyVersion && '* ' === $ constraint && isset ($ versions ['splits ' ][$ package ])) {
318325 // replace unbounded constraints for symfony/* packages by extra.symfony.require
@@ -538,6 +545,7 @@ public function fetchRecipes(array $operations, bool $reset): array
538545 $ recipes = [
539546 'symfony/framework-bundle ' => null ,
540547 ];
548+ $ packRecipes = [];
541549 $ metaRecipes = [];
542550
543551 foreach ($ operations as $ operation ) {
@@ -587,12 +595,16 @@ public function fetchRecipes(array $operations, bool $reset): array
587595 }
588596
589597 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 ;
592604 } elseif ('symfony/flex ' === $ name ) {
593- $ flexRecipe = [$ name => new Recipe ( $ package , $ name , $ job , $ manifests [ $ name ], $ locks [ $ name ] ?? []) ];
605+ $ flexRecipe = [$ name => $ recipe ];
594606 } else {
595- $ recipes [$ name ] = new Recipe ( $ package , $ name , $ job , $ manifests [ $ name ], $ locks [ $ name ] ?? []) ;
607+ $ recipes [$ name ] = $ recipe ;
596608 }
597609 }
598610
@@ -618,7 +630,7 @@ public function fetchRecipes(array $operations, bool $reset): array
618630 }
619631 }
620632
621- return array_merge ($ flexRecipe , $ metaRecipes , array_filter ($ recipes ));
633+ return array_merge ($ flexRecipe , $ packRecipes , $ metaRecipes , array_filter ($ recipes ));
622634 }
623635
624636 public function truncatePackages (PrePoolCreateEvent $ event )
0 commit comments