|
| 1 | +.. index:: |
| 2 | + single: Upgrading; Minor Version |
| 3 | + |
| 4 | +Upgrading a Minor Version (e.g. 2.5.3 to 2.6.1) |
| 5 | +=============================================== |
| 6 | + |
| 7 | +If you're upgrading a minor version (where the middle number changes), then |
| 8 | +you should *not* encounter significant backwards compatibility changes. For |
| 9 | +details, see the :doc:`Symfony backwards compatibility promise </contributing/code/bc>`. |
| 10 | + |
| 11 | +However, some backwards-compatibility breaks *are* possible and you'll learn in |
| 12 | +a second how to prepare for them. |
| 13 | + |
| 14 | +There are two steps to upgrading a minor version: |
| 15 | + |
| 16 | +#. :ref:`Update the Symfony library via Composer <upgrade-minor-symfony-composer>`; |
| 17 | +#. :ref:`Update your code to work with the new version <upgrade-minor-symfony-code>`. |
| 18 | + |
| 19 | +.. _`upgrade-minor-symfony-composer`: |
| 20 | + |
| 21 | +1) Update the Symfony Library via Composer |
| 22 | +------------------------------------------ |
| 23 | + |
| 24 | +First, you need to update Symfony by modifying your ``composer.json`` file |
| 25 | +to use the new version: |
| 26 | + |
| 27 | +.. code-block:: json |
| 28 | +
|
| 29 | + { |
| 30 | + "...": "...", |
| 31 | +
|
| 32 | + "require": { |
| 33 | + "symfony/symfony": "2.6.*", |
| 34 | + }, |
| 35 | + "...": "...", |
| 36 | + } |
| 37 | +
|
| 38 | +Next, use Composer to download new versions of the libraries: |
| 39 | + |
| 40 | +.. code-block:: bash |
| 41 | +
|
| 42 | + $ composer update symfony/symfony |
| 43 | +
|
| 44 | +.. include:: /cookbook/upgrade/_update_all_packages.rst.inc |
| 45 | + |
| 46 | +.. _`upgrade-minor-symfony-code`: |
| 47 | + |
| 48 | +2) Updating Your Code to Work with the new Version |
| 49 | +-------------------------------------------------- |
| 50 | + |
| 51 | +In theory, you should be done! However, you *may* need to make a few changes |
| 52 | +to your code to get everything working. Additionally, some features you're |
| 53 | +using might still work, but might now be deprecated. While that's just fine, |
| 54 | +if you know about these deprecations, you can start to fix them over time. |
| 55 | + |
| 56 | +Every version of Symfony comes with an UPGRADE file included in the Symfony |
| 57 | +directory that describes these changes. If you follow the instructions in the |
| 58 | +document and update your code accordingly, it should be save to update in the |
| 59 | +future. |
| 60 | + |
| 61 | +These documents can also be found in the `Symfony Repository`_. |
| 62 | + |
| 63 | +.. _`Symfony Repository`: https://github.com/symfony/symfony |
0 commit comments