What is a Symfony flex ? From the official docs you can find that it is a tool used in newer versions of Symfony (default from Symfony 4, but also available from Symfony 3.3) to manage and install Symfony apps and it's bundles.
Symfony flex is based on Symfony Recipes, which are a set of automated instructions used to integrate bundles in Symfony apps.
https://flex.symfony.com/ page contains a list of these Symfony Recipes, both official (endorsed by Symfony project creators) and contrib (contributed by Symfony community developers)
What differences in installation Flex introduces ?
In essence, with Flex now we are glueing up our app from the minimal amount of components and bundles, instead of installing big Standard Edition Symfony application.
You can see that with the introduction of Flex, Standard Edition Symfony package is now gone (or should be removed if you're migrating to Flex based app):
$ composer remove symfony/symfony
Before the Flex, Symfony was installed as a Standar Edition, meaning the standard installation had all of the necessary components to run full stack web application.
With Flex things are a bit different. While we have the option to install only minimal app (suitable for API's) , or install traditional MVC based app by running either or commands:
$ symfony new my_project_name
$ symfony new my_project_name --full
, we will still see that a lot of packages(bundles) we used to rely on that can be missing, like templating component, so you'd need to install them additionally.
Different folder structure
With the flex, the new folder structure is like this (although it's possible to make modifications)
your-project/ ├── assets/ ├── bin/ │ └── console ├── config/ │ ├── bundles.php │ ├── packages/ │ ├── routes.yaml │ └── services.yaml ├── public/ │ └── index.php ├── src/ │ ├── ... │ └── Kernel.php ├── templates/ ├── tests/ ├── translations/ ├── var/ └── vendor/
You can see that the /app folder is gone, app/Resources/views/ was moved into it's separate templates/ folder.
src/AppBundle/* is now gone, so Controllers, Entities, Services, etc. now shold be present under the "src/" folder.
One more noticeable change is with the config files. Previously config files had suffixes, such as *_dev.yml and *_prod.yml, and were located in app/config/config_dev.yml. With Flex they're now located in config/packages/prod, config/packages/test, config/packages/dev/ folders.
There are more changes in the new structure, you can read about it in the official documentation here.
Some changes in the way how packages/bundles are installed
Because Symfony flex is based on the Symfony Recipes, now a lot of Symfony packages are available through Recipes, which means some automation in installing, removing are available.
For instance, before Symfony Flex, you can remember that the new bundle needed to be added in AppKernel.php to be able to use it. Flex does this automatically for you. The same thing with uninstalling the packages, it gets cleaned automatically too.
Also you will notice that now new config files can be added automatically for each new installed bundle with the default configuration in it. So it basically automates and quickens the development proces of adding new bundles.
There is still some confusion about Symfony Flex and what it does and I gues it is because of lack of easy and detailed documentation.
However, Flex is not that hard to understand - what it does is it basically help to speed up app development (Rapid application development) with some on-install automation and flexible bundle structure.
You can find a list of Symfony Recipes in the following page: https://flex.symfony.com/.