Why to PHP? It's the best format for PHP Symfony applications:
- Modernize Symfony Configs
- 10 Cool Features You Get after switching from YAML to PHP Configs
- How to Switch from YAML/XML Configs to PHP Today with Symplify
composer require symplify/config-transformer --dev
By default, the command uses /config
directory to transform all files in it.
At first, run it with --dry-run
to see what files would be transformed:
vendor/bin/config-transformer --dry-run
Do you want to convert single file or directory at a time? Specify the paths as arguments:
vendor/bin/config-transformer config/parameters.yml --dry-run
Are you ready to go? Remove --dry-run
:
vendor/bin/config-transformer
The input files are deleted automatically.
It's typical to upgrade first services and then routes as follow up PR. To do that, use --skip-routes
option:
vendor/bin/config-transformer --skip-routes