Skip to content

Adding details about new recipes:update command #16301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .doctor-rst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ whitelist:
- '.. versionadded:: 1.11' # MakerBundle
- '.. versionadded:: 1.3' # MakerBundle
- '.. versionadded:: 1.8' # MakerBundle
- '.. versionadded:: 1.6' # Flex in setup/upgrade_minor.rst
- '.. versionadded:: 1.18' # Flex in setup/upgrade_minor.rst
- '0 => 123' # assertion for var_dumper - components/var_dumper.rst
- '1 => "foo"' # assertion for var_dumper - components/var_dumper.rst
- '$var .= "Because of this `\xE9` octet (\\xE9),\n";'
Expand Down
5 changes: 4 additions & 1 deletion performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@ You can configure PHP to use this preload file:

; php.ini
opcache.preload=/path/to/project/config/preload.php

; required for opcache.preload:
opcache.preload_user=www-data

If this file is missing, run this command to update the Symfony Flex recipe:
``composer recipes:update symfony/framework-bundle``.

.. _performance-configure-opcache:

Configure OPcache for Maximum Performance
Expand Down
29 changes: 12 additions & 17 deletions setup/_update_recipes.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,25 @@ it's a good idea to keep your files in sync with the recipes.
Symfony Flex provides several commands to help upgrade your recipes. Be sure to
commit any unrelated changes you're working on before starting:

.. versionadded:: 1.6
.. versionadded:: 1.18

The recipes commands were introduced in Symfony Flex 1.6.
The ``recipes:update`` command was introduced in Symfony Flex 1.18.

.. code-block:: terminal

# choose an outdated recipe to update
$ composer recipes:update

# update a specific recipe
$ composer recipes:update symfony/framework-bundle

# see a list of all installed recipes and which have updates available
$ composer recipes

# see detailed information about a specific recipes
$ composer recipes symfony/framework-bundle

# update a specific recipes
$ composer recipes:install symfony/framework-bundle --force -v

The tricky part of this process is that the recipe "update" does not perform
any intelligent "upgrading" of your code. Instead, **the updates process re-installs
the latest version of the recipe** which means that **your custom code will be
overridden completely**. After updating a recipe, you need to carefully choose
which changes you want, and undo the rest.

.. admonition:: Screencast
:class: screencast

For a detailed example, see the `SymfonyCasts Symfony 5 Upgrade Tutorial`_.

.. _`SymfonyCasts Symfony 5 Upgrade Tutorial`: https://symfonycasts.com/screencast/symfony5-upgrade
The ``recipes:update`` command is smart: it looks at the difference between the
recipe when you installed it and the latest version. It then creates a patch and
applies it to your app. If there are any conflicts, you can resolve them like a
normal ``git`` conflict and commit like normal.