8000 Add an explain section to update symfony recipes · symfony/symfony-docs@a69e82e · GitHub
[go: up one dir, main page]

Skip to content

Commit a69e82e

Browse files
committed
Add an explain section to update symfony recipes
1 parent 44988e0 commit a69e82e

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

setup/upgrade_major.rst

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Now, you can start fixing the notices:
8484
OK (10 tests, 20 assertions)
8585
8686
Remaining deprecation notices (6)
87-
87+
8888
The "request" service is deprecated and will be removed in 3.0. Add a type-hint for
8989
Symfony\Component\HttpFoundation\Request to your controller parameters to retrieve the
9090
request instead: 6x
@@ -178,9 +178,48 @@ Next, use Composer to download new versions of the libraries:
178178

179179
.. _upgrade-major-symfony-after:
180180

181-
3) Update your Code to Work with the New Version
181+
3) Updating Recipes
182+
-------------------
183+
184+
Over time - and especially when you upgrade to a new version of a library - an
185+
updated version of the :ref:`recipe <recipes-description>` may be available.
186+
These updates are usually minor - e.g. new comments in a configuration file - but
187+
it's a good idea to update the core Symfony recipes.
188+
189+
Symfony Flex provides several commands to help upgrade your recipes. Be sure to
190+
commit any unrelated changes you're working on before starting:
191+
192+
.. versionadded:: 1.6
193+
194+
The recipes commands were introduced in Symfony Flex 1.6.
195+
196+
.. code-block:: terminal
197+
198+
# see a list of all installed recipes and which have updates available
199+
$ composer recipes
200+
201+
# see detailed information about a specific recipes
202+
$ composer recipes symfony/framework-bundle
203+
204+
# update a specific recipes
205+
$ composer recipes:install symfony/framework-bundle --force -v
206+
207+
The tricky part of this process is that the recipe "update" does not perform
208+
any intelligent "upgrading" of your code. Instead, **the updates process re-installs
209+
the latest version of the recipe** which means that **your custom code will be
210+
overridden completely**. After updating a recipe, you need to carefully choose
211+
which changes you want, and undo the rest.
212+
213+
.. admonition:: Screencast
214+
:class: screencast
215+
216+
For a detailed example, see the `SymfonyCasts Symfony 5 Upgrade Tutorial`_.
217+
218+
4) Update your Code to Work with the New Version
182219
------------------------------------------------
183220

184221
In some rare situations, the next major version *may* contain backwards-compatibility
185222
breaks. Make sure you read the ``UPGRADE-X.0.md`` (where X is the new major version)
186223
included in the Symfony repository for any BC break that you need to be aware of.
224+
225+
.. _`SymfonyCasts Symfony 5 Upgrade Tutorial`: https://symfonycasts.com/screencast/symfony5-upgrade

0 commit comments

Comments
 (0)
0