11.. index ::
22 single: Upgrading; Major Version
33
4- Upgrading a Major Version (e.g. 2.7 .0 to 3 .0.0)
4+ Upgrading a Major Version (e.g. 3.4 .0 to 4 .0.0)
55===============================================
66
77Every two years, Symfony releases a new major version release (the first number
@@ -30,10 +30,10 @@ backwards incompatible changes. To accomplish this, the "old" (e.g. functions,
3030classes, etc) code still works, but is marked as *deprecated *, indicating that
3131it will be removed/changed in the future and that you should stop using it.
3232
33- When the major version is released (e.g. 3 .0.0), all deprecated features and
33+ When the major version is released (e.g. 4 .0.0), all deprecated features and
3434functionality are removed. So, as long as you've updated your code to stop
3535using these deprecated features in the last version before the major (e.g.
36- 2.8 .*), you should be able to upgrade without a problem.
36+ 3.4 .*), you should be able to upgrade without a problem.
3737
3838To help you with this, deprecation notices are triggered whenever you end up
3939using a deprecated feature. When visiting your application in the
9595.. sidebar :: Using the Weak Deprecations Mode
9696
9797 Sometimes, you can't fix all deprecations (e.g. something was deprecated
98- in 2.8 and you still need to support 2.7 ). In these cases, you can still
98+ in 3.4 and you still need to support 3.3 ). In these cases, you can still
9999 use the bridge to fix as many deprecations as possible and then switch
100100 to the weak test mode to make your tests pass again. You can do this by
101101 using the ``SYMFONY_DEPRECATIONS_HELPER `` env variable:
@@ -113,12 +113,6 @@ done!
113113
114114 (you can also execute the command like ``SYMFONY_DEPRECATIONS_HELPER=weak phpunit ``).
115115
116- .. tip ::
117-
118- Some members of the Symfony Community have developed a tool called
119- `Symfony-Upgrade-Fixer `_ which automatically fixes some of the most common
120- deprecations found when upgrading from Symfony 2 to Symfony 3.
121-
122116.. _upgrade-major-symfony-composer :
123117
1241182) Update to the New Major Version via Composer
@@ -133,7 +127,7 @@ Composer by modifying your ``composer.json`` file:
133127 "..." : " ..." ,
134128
135129 "require" : {
136- "symfony/symfony" : " 3.0.* " ,
130+ "symfony/symfony" : " ^4.0 " ,
137131 },
138132 "..." : " ..."
139133 }
@@ -153,10 +147,16 @@ Next, use Composer to download new versions of the libraries:
1531473) Update your Code to Work with the New Version
154148------------------------------------------------
155149
156- There is a good chance that you're done now! However, the next major version
157- *may * also contain new BC breaks as a BC layer is not always a possibility.
158- Make sure you read the ``UPGRADE-X.0.md `` (where X is the new major version)
159- included in the Symfony repository for any BC break that you need to be aware
150+ The next major version *may * also contain new BC breaks as a BC layer is not always
151+ a possibility. Make sure you read the ``UPGRADE-X.0.md `` (where X is the new major
152+ version) included in the Symfony repository for any BC break that you need to be aware
160153of.
161154
155+ 4) Updating to the Symfony 4 Flex Directory Structure
156+ -----------------------------------------------------
157+
158+ When upgrading to Symfony 4, you will probably also want to upgrade to the new
159+ Symfony 4 directory structure so that you can take advantage of Symfony Flex.
160+ This takes some work, but is optional. For details, see :ref: `upgrade-to-flex `.
161+
162162.. _`Symfony-Upgrade-Fixer` : https://github.com/umpirsky/Symfony-Upgrade-Fixer
0 commit comments