@@ -22,37 +22,43 @@ There are two steps to upgrading a minor version:
22
22
------------------------------------------
23
23
24
24
The ``composer.json `` file is configured to allow Symfony packages to be
25
- upgraded to patch versions. But, if you would like the packages to be upgraded
26
- to minor versions, check that the version constrains of the Symfony dependencies
27
- are like this :
25
+ upgraded to patch versions. But to upgrade to a new minor version, you will
26
+ probably need to update the version constraint next to each library starting
27
+ `` symfony/ ``. Suppose you are upgrading from Symfony 4.3 to 4.4 :
28
28
29
- .. code-block :: json
29
+ .. code-block :: diff
30
30
31
31
{
32
32
"...": "...",
33
33
34
34
"require": {
35
- "symfony/cache" : " ^4.0" ,
36
- "symfony/config" : " ^4.0" ,
37
- "symfony/console" : " ^4.0" ,
38
- "symfony/debug" : " ^4.0" ,
39
- "symfony/dependency-injection" : " ^4.0" ,
40
- "symfony/dotenv" : " ^4.0" ,
41
- "..." : " ..."
35
+ - "symfony/cache": "4.3.*",
36
+ + "symfony/cache": "4.4.*",
37
+ - "symfony/config": "4.3.*",
38
+ + "symfony/config": "4.4.*",
39
+ - "symfony/console": "4.3.*",
40
+ + "symfony/console": "4.4.*",
41
+ "...": "...",
42
+
43
+ "...": "A few libraries starting with
44
+ symfony/ follow their versioning scheme. You
45
+ do not need to update these versions: you can
46
+ upgrade them independently whenever you want",
47
+ "symfony/monolog-bundle": "^3.5",
42
48
},
43
49
"...": "...",
44
50
}
45
51
46
- At the bottom of your ``composer.json `` file, in the ``extra `` block you can
47
- find a data setting for the symfony version. Make sure to also upgrade
48
- this one. For instance, update it to ``4.3.* `` to upgrade to Symfony 4.3:
52
+ Your ``composer.json `` file should also have an ``extra `` block that you will
53
+ *also * need to update:
49
54
50
- .. code-block :: json
55
+ .. code-block :: diff
51
56
52
57
"extra": {
53
58
"symfony": {
54
- "allow-contrib" : false ,
55
- "require" : " 4.3.*"
59
+ "...": "...",
60
+ - "require": "4.3.*"
61
+ + "require": "4.4.*"
56
62
}
57
63
}
58
64
@@ -76,12 +82,45 @@ to your code to get everything working. Additionally, some features you're
76
82
using might still work, but might now be deprecated. While that's just fine,
77
83
if you know about these deprecations, you can start to fix them over time.
78
84
79
- Every version of Symfony comes with an UPGRADE file (e.g. `UPGRADE-4.1 .md `_)
85
+ Every version of Symfony comes with an UPGRADE file (e.g. `UPGRADE-4.4 .md `_)
80
86
included in the Symfony directory that describes these changes. If you follow
81
87
the instructions in the document and update your code accordingly, it should be
82
88
safe to update in the future.
83
89
84
90
These documents can also be found in the `Symfony Repository `_.
85
91
92
+ .. _updating-flex-recipes :
93
+
94
+ 3) Updating Recipes
95
+ -------------------
96
+
97
+ Over time - and especially when you upgrade to a new version of a library, an
98
+ updating version of the :ref: `recipe <recipes-description >` may be available.
99
+ These updates are usually minor - e.g. new comments in a configuration file - but
100
+ it's a good idea to update the core Symfony recipes.
101
+
102
+ Starting in ``symfony/flex `` version 1.6, several commands are available to help
103
+ upgrade your recipes:
104
+
105
+ .. code-block :: terminal
106
+
107
+ # see a list of all installed recipes and which have updates available
108
+ $ composer recipes
109
+
110
+ # see detailed information about a specific recipes
111
+ $ composer recipes symfony/framework-bundle
112
+
113
+ # update a specific recipes
114
+ $ composer recipes:install symfony/framework-bundle --force -v
115
+
116
+ The tricky part of this process is that the recipe "update" does not perform
117
+ any intelligent "upgrading" of your code. Instead, **the updates process re-installs
118
+ the latest version of the recipe ** which means that **your custom code will be
119
+ overridden completely **. After updating a recipe, you need to carefully choose
120
+ which changes you want, and undo the rest.
121
+
122
+ For a detailed example, see the `SymfonyCasts Symfony 5 Upgrade Tutorial `_.
123
+
86
124
.. _`Symfony Repository` : https://github.com/symfony/symfony
87
- .. _`UPGRADE-4.1.md` : https://github.com/symfony/symfony/blob/4.1/UPGRADE-4.1.md
125
+ .. _`UPGRADE-4.4.md` : https://github.com/symfony/symfony/blob/4.4/UPGRADE-4.4.md
126
+ .. _`SymfonyCasts Symfony 5 Upgrade Tutorial` : https://symfonycasts.com/screencast/symfony5-upgrade
0 commit comments