From 2edcbf65d4c95254635455268bdc2ffa6cb4aee0 Mon Sep 17 00:00:00 2001 From: martijn Date: Mon, 25 Jun 2018 18:42:08 +0200 Subject: [PATCH 1/2] Different way for updating flex projects --- setup/_update_dep_errors.rst.inc | 2 +- setup/upgrade_minor.rst | 24 +++++++++++++++++------- setup/upgrade_patch.rst | 6 +++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/setup/_update_dep_errors.rst.inc b/setup/_update_dep_errors.rst.inc index 6eeb0d3f8d5..af8ac0a67d6 100644 --- a/setup/_update_dep_errors.rst.inc +++ b/setup/_update_dep_errors.rst.inc @@ -6,7 +6,7 @@ other Symfony dependencies too. In that case, try the following command: .. code-block:: terminal - $ composer update symfony/symfony --with-dependencies + $ composer update "symfony/*" --with-dependencies This updates ``symfony/symfony`` and *all* packages that it depends on, which will include several other packages. By using tight version constraints in diff --git a/setup/upgrade_minor.rst b/setup/upgrade_minor.rst index 1cdf6e70109..3ba7906ed5a 100644 --- a/setup/upgrade_minor.rst +++ b/setup/upgrade_minor.rst @@ -1,7 +1,7 @@ .. index:: single: Upgrading; Minor Version -Upgrading a Minor Version (e.g. 3.3.3 to 3.4.0) +Upgrading a Minor Version (e.g. 4.0.0 to 4.1.0) =============================================== If you're upgrading a minor version (where the middle number changes), then @@ -21,8 +21,8 @@ There are two steps to upgrading a minor version: 1) Update the Symfony Library via Composer ------------------------------------------ -First, you need to update Symfony by modifying your ``composer.json`` file -to use the new version: +First, you need to update all Symfony packages by modifying your ``composer.json`` file +to use the new version (the list of packages may vary depending on what you've installed): .. code-block:: json @@ -30,7 +30,17 @@ to use the new version: "...": "...", "require": { - "symfony/symfony": "3.4.*", + "symfony/asset": "^4.1", + "symfony/console": "^4.1", + "symfony/expression-language": "^4.1", + "symfony/form": "^4.1", + "symfony/framework-bundle": "^4.1", + "symfony/process": "^4.1", + "symfony/security-bundle": "^4.1", + "symfony/twig-bundle": "^4.1", + "symfony/validator": "^4.1", + "symfony/web-link": "^4.1", + "symfony/yaml": "^4.1" }, "...": "...", } @@ -39,7 +49,7 @@ Next, use Composer to download new versions of the libraries: .. code-block:: terminal - $ composer update symfony/symfony + $ composer update "symfony/*" .. include:: /setup/_update_dep_errors.rst.inc @@ -55,7 +65,7 @@ to your code to get everything working. Additionally, some features you're using might still work, but might now be deprecated. While that's just fine, if you know about these deprecations, you can start to fix them over time. -Every version of Symfony comes with an UPGRADE file (e.g. `UPGRADE-3.4.md`_) +Every version of Symfony comes with an UPGRADE file (e.g. `UPGRADE-4.1.md`_) included in the Symfony directory that describes these changes. If you follow the instructions in the document and update your code accordingly, it should be safe to update in the future. @@ -63,4 +73,4 @@ safe to update in the future. These documents can also be found in the `Symfony Repository`_. .. _`Symfony Repository`: https://github.com/symfony/symfony -.. _`UPGRADE-3.4.md`: https://github.com/symfony/symfony/blob/3.4/UPGRADE-3.4.md +.. _`UPGRADE-4.1.md`: https://github.com/symfony/symfony/blob/4.1/UPGRADE-4.1.md diff --git a/setup/upgrade_patch.rst b/setup/upgrade_patch.rst index 71140bb9411..66b29f73f94 100644 --- a/setup/upgrade_patch.rst +++ b/setup/upgrade_patch.rst @@ -1,7 +1,7 @@ .. index:: single: Upgrading; Patch Version -Upgrading a Patch Version (e.g. 3.3.2 to 3.3.3) +Upgrading a Patch Version (e.g. 4.1.0 to 4.1.1) =============================================== When a new patch version is released (only the last number changed), it is a @@ -10,12 +10,12 @@ version is *really* easy: .. code-block:: terminal - $ composer update symfony/symfony + $ composer update "symfony/*" That's it! You should not encounter any backwards-compatibility breaks or need to change anything else in your code. That's because when you started your project, your ``composer.json`` included Symfony using a constraint -like ``3.3.*``, where only the *last* version number will change when you +like ``^4.1``, where only the *last* version number will change when you update. .. tip:: From 0c2129bb33cb838fc1ef1c6c6a7835192f032b4a Mon Sep 17 00:00:00 2001 From: martijn Date: Tue, 17 Jul 2018 10:58:01 +0200 Subject: [PATCH 2/2] Suggested changes --- setup/_update_dep_errors.rst.inc | 2 +- setup/upgrade_minor.rst | 27 +++++++++++++-------------- setup/upgrade_patch.rst | 10 +--------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/setup/_update_dep_errors.rst.inc b/setup/_update_dep_errors.rst.inc index af8ac0a67d6..0a829eefce1 100644 --- a/setup/_update_dep_errors.rst.inc +++ b/setup/_update_dep_errors.rst.inc @@ -6,7 +6,7 @@ other Symfony dependencies too. In that case, try the following command: .. code-block:: terminal - $ composer update "symfony/*" --with-dependencies + $ composer update "symfony/*" --with-all-dependencies This updates ``symfony/symfony`` and *all* packages that it depends on, which will include several other packages. By using tight version constraints in diff --git a/setup/upgrade_minor.rst b/setup/upgrade_minor.rst index 3ba7906ed5a..e0652a68139 100644 --- a/setup/upgrade_minor.rst +++ b/setup/upgrade_minor.rst @@ -21,8 +21,7 @@ There are two steps to upgrading a minor version: 1) Update the Symfony Library via Composer ------------------------------------------ -First, you need to update all Symfony packages by modifying your ``composer.json`` file -to use the new version (the list of packages may vary depending on what you've installed): +Your composer.json file should already be configured to allow your Symfony packages to be upgraded minor versions. But, if a package was not upgraded that should have been, check your ``composer.json`` file. .. code-block:: json @@ -30,17 +29,17 @@ to use the new version (the list of packages may vary depending on what you've i "...": "...", "require": { - "symfony/asset": "^4.1", - "symfony/console": "^4.1", - "symfony/expression-language": "^4.1", - "symfony/form": "^4.1", - "symfony/framework-bundle": "^4.1", - "symfony/process": "^4.1", - "symfony/security-bundle": "^4.1", - "symfony/twig-bundle": "^4.1", - "symfony/validator": "^4.1", - "symfony/web-link": "^4.1", - "symfony/yaml": "^4.1" + "symfony/asset": "^4.0", + "symfony/console": "^4.0", + "symfony/expression-language": "^4.0", + "symfony/form": "^4.0", + "symfony/framework-bundle": "^4.0", + "symfony/process": "^4.0", + "symfony/security-bundle": "^4.0", + "symfony/twig-bundle": "^4.0", + "symfony/validator": "^4.0", + "symfony/web-link": "^4.0", + "symfony/yaml": "^4.0" }, "...": "...", } @@ -49,7 +48,7 @@ Next, use Composer to download new versions of the libraries: .. code-block:: terminal - $ composer update "symfony/*" + $ composer update "symfony/*" --with-all-dependencies .. include:: /setup/_update_dep_errors.rst.inc diff --git a/setup/upgrade_patch.rst b/setup/upgrade_patch.rst index 66b29f73f94..098e959ab70 100644 --- a/setup/upgrade_patch.rst +++ b/setup/upgrade_patch.rst @@ -8,15 +8,7 @@ When a new patch version is released (only the last number changed), it is a release that only contains bug fixes. This means that upgrading to a new patch version is *really* easy: -.. code-block:: terminal - - $ composer update "symfony/*" - -That's it! You should not encounter any backwards-compatibility breaks or -need to change anything else in your code. That's because when you started -your project, your ``composer.json`` included Symfony using a constraint -like ``^4.1``, where only the *last* version number will change when you -update. +To upgrade to a new "patch" release, see the :doc:Upgrading a Minor Version documentation. Thanks to Symfony's backwards compatibility promise, it's always safe to upgrade to the latest "minor" version. .. tip::