I just want to know which is the proper way to upgrade symfony a minor version.
In the documentation https://symfony.com/doc/current/setup/upgrade_minor.html it says just to upgrade symfony/symfony package in composer, but I don't have this package, instead I have various symfony/framework-bundle, symfony/form, etc.
What I've done so far is to upgrade all symfony/XXX to the new version.
Also I had to create a new project with the 4.2 version in other folder, and copy the files .gitignore
, public/index.php
, config/bootstrap.php
and src/kernel.php
to the original project as these files has changed from 4.1 to 4.2, but I think this should not be the way to do it.
Should I have to remove all symfony/XX packages and replace them with symfony/symfony?
Will this upgrade also the files public/index.php
, config/bootstra.php
, etc?
Thank you
In my case I was updating to 4.2 from 4.1.11 and some new files from 4.2 for some reason weren't automatically created. Also, there are a few changes in environment files that I consider very important.
I think the best and cleanest way to do this to do the following:
Instructions
composer.json
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.2.*"
}
}
composer update "symfony/*"
config/bootstrap.php
file with this code.public/index.php
file with this code..gitignore
Remove
###> symfony/framework-bundle ###
/.env
Add
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
.env
to .env.local
.env.dist
to .env
-- Update 30/05/19 --
bin/console
file with this code
Testing with PHPUnit
Follow this extra steps if you are using PHPUnit in your application (Recommended):
.env.test
and set your variables for test environment.phpunit.xml.dist
with this code.Important
You should notify about the environment files changes to your team and they should make a backup of their current configuration before pulling the changes because it will override the .env
file.
If you need more information about this solution please read: https://symfony.com/doc/current/configuration/dot-env-changes.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With