Replies: 2 comments 11 replies
-
Short summary :
|
Beta Was this translation helpful? Give feedback.
-
Composer is a tool for all of PHP. Flex is a Composer plugin that hooks into Composer to do some stuff for Symfony applications. So it can't just be integrated into Composer because many of the things Flex does don't apply to Laravel, Laminas, Yii, or framework-less environments.
For Composer, there is no difference between a package and a bundle. A bundle is a Symfony framework concept, the common use cases include integrating a standalone PHP package into a Symfony application or extending Symfony framework features. A recipe is indeed a feature of the Flex plugin. It's entirely opt-in, but part of what it offers is the ability to add in opinionated default configurations and files to your Symfony application.
Because most of the time bundles are integrating PHP packages that don't have Symfony-specific optimizations built right into them. Two examples of different types of bundles and their relationships with more generic PHP packages:
|
Beta Was this translation helpful? Give feedback.
-
If I understand correctly, bundle is a synonym for package, but a recipe is something different. It seems that a recipe is a Symfony Flex concept. My understanding is that a recipe is a way to install a bundle (aka package) and automatically set certain configuration options for that bundle/package.
If this is all correct, I don't understand why aren't all packages recipes and why is Symfony Flex not integrated into
composer
. Why isn't the installation of recipes the default behavior? Are there cases where we need just to install bundles without sensible defaults? If yes, can you provide a few examples?Also, is there a command, which I can type on the terminal, that lists only the recipes, and another that lists only the packages, or a single command that can show if something is a recipe or just a bundle? I couldn't find that in
composer show --help
Beta Was this translation helpful? Give feedback.
All reactions