1
1
.. index ::
2
2
single: Upgrading; Major Version
3
3
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)
5
5
===============================================
6
6
7
7
Every 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,
30
30
classes, etc) code still works, but is marked as *deprecated *, indicating that
31
31
it will be removed/changed in the future and that you should stop using it.
32
32
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
34
34
functionality are removed. So, as long as you've updated your code to stop
35
35
using 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.
37
37
38
38
To help you with this, deprecation notices are triggered whenever you end up
39
39
using a deprecated feature. When visiting your application in the
95
95
.. sidebar :: Using the Weak Deprecations Mode
96
96
97
97
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
99
99
use the bridge to fix as many deprecations as possible and then switch
100
100
to the weak test mode to make your tests pass again. You can do this by
101
101
using the ``SYMFONY_DEPRECATIONS_HELPER `` env variable:
@@ -113,12 +113,6 @@ done!
113
113
114
114
(you can also execute the command like ``SYMFONY_DEPRECATIONS_HELPER=weak phpunit ``).
115
115
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
-
122
116
.. _upgrade-major-symfony-composer :
123
117
124
118
2) Update to the New Major Version via Composer
@@ -133,7 +127,7 @@ Composer by modifying your ``composer.json`` file:
133
127
"..." : " ..." ,
134
128
135
129
"require" : {
136
- "symfony/symfony" : " 3.0.* " ,
130
+ "symfony/symfony" : " ^4.0 " ,
137
131
},
138
132
"..." : " ..."
139
133
}
@@ -153,10 +147,16 @@ Next, use Composer to download new versions of the libraries:
153
147
3) Update your Code to Work with the New Version
154
148
------------------------------------------------
155
149
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
160
153
of.
161
154
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
+
162
162
.. _`Symfony-Upgrade-Fixer` : https://github.com/umpirsky/Symfony-Upgrade-Fixer
0 commit comments