Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 5a9604f

Browse files
authored
Merge pull request #2581 from magento-commerce/kh_composer-plugin
Change composer require to require-commerce
2 parents 7c08bc0 + 91876a8 commit 5a9604f

File tree

4 files changed

+104
-42
lines changed

4 files changed

+104
-42
lines changed

src/guides/v2.3/comp-mgr/cli/cli-upgrade.md

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,19 @@ Complete the following prerequisites to prepare your environment before starting
4141

4242
The plugin partially automates the manual upgrade by identifying and helping you resolve dependency conflicts instead of requiring you to identify and fix them manually.
4343

44-
To install the plugin:
44+
To install the plugin when using PHP 7.3 or higher:
4545

4646
```bash
47-
composer require magento/composer-root-update-plugin=~1.0 --no-update
47+
composer require magento/composer-root-update-plugin ~2.0 --no-update
48+
```
49+
50+
To install the plugin when using PHP 7.2 or lower:
51+
52+
{:.bs-callout-info}
53+
This version of the plugin is not compatible with Composer 2.1.6 or higher
54+
55+
```bash
56+
composer require magento/composer-root-update-plugin ~1.1 --no-update
4857
```
4958

5059
Update the dependencies:
@@ -70,28 +79,53 @@ See the examples at the end of this section for help specifying different releas
7079
composer remove magento/product-community-edition --no-update
7180
```
7281

73-
1. Indicate the Magento packages, both the edition (`community` or `enterprise`) and the version (`{{ page.guide_version }}.0`), that you want to upgrade to.
82+
1. Choose one of the following `composer` commands based on the PHP version, and run the command to upgrade your instance.
7483

75-
{:.bs-callout-info}
76-
The first time you upgrade using the plugin, you can interactively view and update any out-of-date values that may be remaining from previous versions.
77-
To enable this, use the `--interactive-magento-conflicts` option on the `composer require` commands.
84+
For 7.3 or higher:
85+
86+
```bash
87+
composer require-commerce magento/<product> <version> --no-update [--interactive-root-conflicts] [--force-root-updates] [--help]
88+
```
89+
90+
For PHP 7.2 or lower:
91+
92+
```bash
93+
composer require magento/<product> <version> --no-update [--interactive-magento-conflicts] [--use-default-magento-values] [--help]
94+
```
7895

79-
To override all conflicting custom values with the expected Magento values, re-run the `composer require` command with the `--use-default-magento-values` option.
96+
where:
8097

81-
{:.bs-callout-tip}
82-
Use `composer require --help` to learn more about available options.
83-
To learn more about usage of the plugin, refer to the [Plugin Usage](https://github.com/magento/composer-root-update-plugin/blob/0.1/src/Magento/ComposerRootUpdatePlugin/README.md#usage).
98+
`<product>` - (Required) The package to upgrade. For on-premises installations, you must specify either `product-community-edition` or `product-enterprise-edition`.
99+
100+
`<version>` - (Required) The version of {{site.data.var.ce}} or {{site.data.var.ce}} you are upgrading to. For example, `2.3.7`.
101+
102+
`--no-update` - (Required) Disables the automatic update of the dependencies.
103+
104+
`--interactive-root-conflicts` or `interactive-magento-conflicts` - (Optional) Allows you to interactively view and update any out-of-date values from previous versions.
105+
106+
`--force-root-updates` or `--use-default-magento-values` - (Optional) Overrides all conflicting custom values with the expected Magento values.
107+
108+
`--help` - (Optional) Provides usage details about the plugin.
109+
110+
If neither `--interactive-root-conflicts` nor `--force-root-updates` (or their PHP 7.2 equivalents) are specified, the command keeps the existing values that are in conflict and displays a warning message.
111+
112+
To learn more about the plugin, refer to one of the following Plugin Usage README files:
113+
114+
- [PHP 7.3 or higher](https://github.com/magento/composer-root-update-plugin/blob/develop/src/Magento/ComposerRootUpdatePlugin/README.md)
115+
- [PHP 7.2 or lower](https://github.com/magento/composer-root-update-plugin/blob/1.1/src/Magento/ComposerRootUpdatePlugin/README.md)
116+
117+
**Examples:**
84118

85119
_{{ ce }}_:
86120

87121
```bash
88-
composer require magento/product-community-edition={{ page.guide_version }}.7 --no-update
122+
composer require-commerce magento/product-community-edition 2.3.7 --no-update
89123
```
90124

91125
_{{ ee }}_:
92126

93127
```bash
94-
composer require magento/product-enterprise-edition={{ page.guide_version }}.7 --no-update
128+
composer require-commerce magento/product-enterprise-edition 2.3.7 --no-update
95129
```
96130

97131
<div class="bs-callout-tip" markdown="1">
@@ -100,41 +134,47 @@ See the examples at the end of this section for help specifying different releas
100134
_{{ ce }}_:
101135

102136
```bash
103-
composer show magento/product-community-edition {{ page.guide_version }}.* --all | grep -m 1 versions
137+
composer show magento/product-community-edition 2.3.* --all | grep -m 1 versions
104138
```
105139

106140
_{{ ee }}_:
107141

108142
```bash
109-
composer show magento/product-enterprise-edition {{ page.guide_version }}.* --all | grep -m 1 versions
143+
composer show magento/product-enterprise-edition 2.3.* --all | grep -m 1 versions
110144
```
111145

112146
</div>
113147

148+
1. Update the dependencies.
149+
150+
```bash
151+
composer update
152+
```
153+
114154
### Example - Minor release
115155

116156
Minor releases contain new features, quality fixes, and security fixes. Use Composer to specify a minor release. For example, to specify the {{site.data.var.ee}} 2.3.7 metapackage:
117157

118158
```bash
119-
composer require magento/product-community-edition=2.3.7 --no-update
159+
composer require-commerce magento/product-community-edition 2.3.7 --no-update
120160
```
121161

122162
### Example - Quality patch
123163

124164
Quality patches primarily contain functional _and_ security fixes. However, they can also sometimes contain new, backward-compatible features. Use Composer to download a quality patch. For example, to specify the {{site.data.var.ee}} 2.3.7 metapackage:
125165

126166
```bash
127-
composer require magento/product-community-edition=2.3.7 --no-update
167+
composer require-commerce magento/product-community-edition 2.3.7 --no-update
128168
```
129169

130170
### Example - Security patch
131171

132172
Security patches contain security fixes only. They are designed to make the upgrade process faster and easier.
133173

134-
Security patches use the Composer naming convention `2.3.6-px`. Use Composer to specify a patch. For example, to download the {{site.data.var.ce}} 2.3.6-p1 metapackage:
174+
Security patches use the Composer naming convention `2.3.x-px`. Use Composer to specify a patch. For example, to download the {{site.data.var.ce}} 2.3.6-p1 metapackage:
135175

136176
```bash
137-
composer require magento/product-community-edition=2.3.6-p1 --no-update
177+
composer require-commerce magento/product-community-edition 2.3.6-p1 --no-update
138178
```
139179

140180
## Update metadata

src/guides/v2.4/comp-mgr/cli/cli-upgrade.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ You can upgrade your Magento application from the command line if you installed
1818
{:.bs-callout-info}
1919
Do not use this method to upgrade if you cloned the Magento 2 GitHub repository. Instead, see [Update Magento][] for upgrade instructions.
2020

21-
The following instructions show you how to upgrade Magento using Composer. Magento 2.4.2 introduced support for Composer 2. If you are attempting to upgrade from Magento <2.4.1, you must first upgrade to a version of Magento that is compatible with Composer 2 (for example, 2.4.2) using Composer 1 _before_ upgrading to Composer 2 for Magento >2.4.2 upgrades.
21+
The following instructions show you how to upgrade Magento using Composer. Magento 2.4.2 introduced support for Composer 2. If you are attempting to upgrade from Magento <2.4.1, you must first upgrade to a version of Magento that is compatible with Composer 2 (for example, 2.4.2) using Composer 1 _before_ upgrading to Composer 2 for Magento >2.4.2 upgrades. In addition, you must be running a [supported version]({{page.baseurl}}/install-gde/system-requirements.html) of PHP.
22+
23+
{:.bs-callout-warning}
24+
The procedure for upgrading {{site.data.var.ce}} and {{site.data.var.ee}} has changed. You must install a new version of the `magento/composer-root-update-plugin` package. In addition, the commands for upgrading have changed from `composer require magento/<package_name>` to `composer require-commerce magento/<package_name>`.
2225

2326
## Before you begin {#prerequisites}
2427

2528
Complete the following prerequisites to prepare your environment before starting the upgrade process:
2629

27-
- **Determine whether your current catalog search engine is supported**-Avoid significant upgrade errors by ensuring your search engine complies with 2.3 requirements. See [Check the catalog search engine] for more details.
30+
- **Determine whether your current catalog search engine is supported**-Avoid significant upgrade errors by ensuring your search engine complies with 2.4 requirements. See [Check the catalog search engine] for more details.
2831
- **Complete the Update and upgrade checklist**—To avoid possible errors during installation or upgrading, complete the [Update and upgrade checklist].
2932
- **Set the `pub/` directory root**—See [Modify docroot to improve security][] for more details.
3033
- **Check PHP and environment settings**—Verify that your PHP and other environment settings are compatible with the [system requirements].
@@ -46,7 +49,7 @@ Complete the following prerequisites to prepare your environment before starting
4649
To install the plugin:
4750

4851
```bash
49-
composer require magento/composer-root-update-plugin=~1.0 --no-update
52+
composer require magento/composer-root-update-plugin ~2.0 --no-update
5053
```
5154

5255
Update the dependencies:
@@ -72,28 +75,42 @@ See the examples at the end of this section for help specifying different releas
7275
composer remove magento/product-community-edition --no-update
7376
```
7477

75-
1. Indicate the Magento packages, both the edition (`community` or `enterprise`) and the version (`{{ page.guide_version }}.0`), that you want to upgrade to.
78+
1. Run the `composer require-commerce` command to upgrade your instance. The command has the following syntax:
7679

77-
{:.bs-callout-info}
78-
The first time you upgrade using the plugin, you can interactively view and update any out-of-date values that may be remaining from previous versions.
79-
To enable this, use the `--interactive-magento-conflicts` option on the `composer require` commands.
80+
```bash
81+
composer require-commerce magento/<product> <version> --no-update [--interactive-root-conflicts] [--force-root-updates] [--help]
82+
```
83+
84+
where:
85+
86+
`<product>` - (Required) The package to upgrade. For on-premises installations, this value must be either `product-community-edition` or `product-enterprise-edition`.
87+
88+
`<version>` - (Required) The version of {{site.data.var.ce}} or {{site.data.var.ce}} you are upgrading to. For example, `2.4.3`.
89+
90+
`--no-update` - (Required) Disables the automatic update of the dependencies.
8091

81-
To override all conflicting custom values with the expected Magento values, re-run the `composer require` command with the `--use-default-magento-values` option.
92+
`--interactive-root-conflicts` - (Optional) Allows you to interactively view and update any out-of-date values from previous versions, or any customized values that do not match the version you are upgrading to.
8293

83-
{:.bs-callout-tip}
84-
Use `composer require --help` to learn more about available options.
85-
To learn more about usage of the plugin, refer to the [Plugin Usage](https://github.com/magento/composer-root-update-plugin/blob/0.1/src/Magento/ComposerRootUpdatePlugin/README.md#usage).
94+
`--force-root-updates` - (Optional) Overrides all conflicting custom values with the expected Magento values.
95+
96+
`--help` - (Optional) Provides usage details about the plugin.
97+
98+
If neither `--interactive-root-conflicts` nor `--force-root-updates` are specified, the command keeps the existing values that are in conflict and displays a warning message.
99+
100+
To learn more about the plugin, refer to the [Plugin Usage README](https://github.com/magento/composer-root-update-plugin/blob/develop/src/Magento/ComposerRootUpdatePlugin/README.md).
101+
102+
**Examples:**
86103

87104
_{{ ce }}_:
88105

89106
```bash
90-
composer require magento/product-community-edition={{ page.guide_version }}.0 --no-update
107+
composer require-commerce magento/product-community-edition 2.4.3 --no-update
91108
```
92109

93110
_{{ ee }}_:
94111

95112
```bash
96-
composer require magento/product-enterprise-edition={{ page.guide_version }}.0 --no-update
113+
composer require-commerce magento/product-enterprise-edition 2.4.3 --no-update
97114
```
98115

99116
<div class="bs-callout-tip" markdown="1">
@@ -102,41 +119,46 @@ See the examples at the end of this section for help specifying different releas
102119
_{{ ce }}_:
103120

104121
```bash
105-
composer show magento/product-community-edition {{ page.guide_version }}.* --available | grep -m 1 versions
122+
composer show magento/product-community-edition 2.4.* --available | grep -m 1 versions
106123
```
107124

108125
_{{ ee }}_:
109126

110127
```bash
111-
composer show magento/product-enterprise-edition {{ page.guide_version }}.* --available | grep -m 1 versions
128+
composer show magento/product-enterprise-edition 2.4.* --available | grep -m 1 versions
112129
```
113130

114131
</div>
115132

133+
1. Update the dependencies.
134+
135+
```bash
136+
composer update
137+
116138
### Example - Minor release
117139
118-
Minor releases contain new features, quality fixes, and security fixes. Use Composer to specify a minor release. For example, to specify the {{site.data.var.ee}} 2.3.7 metapackage:
140+
Minor releases contain new features, quality fixes, and security fixes. Use Composer to specify a minor release. For example, to specify the {{site.data.var.ee}} 2.4.3 metapackage:
119141
120142
```bash
121-
composer require magento/product-community-edition=2.3.7 --no-update
143+
composer require-commerce magento/product-community-edition 2.4.3 --no-update
122144
```
123145
124146
### Example - Quality patch
125147
126-
Quality patches primarily contain functional _and_ security fixes. However, they can also sometimes contain new, backward-compatible features. Use Composer to download a quality patch. For example, to specify the {{site.data.var.ee}} 2.3.7 metapackage:
148+
Quality patches primarily contain functional _and_ security fixes. However, they can also sometimes contain new, backward-compatible features. Use Composer to download a quality patch. For example, to specify the {{site.data.var.ee}} 2.4.1 metapackage:
127149
128150
```bash
129-
composer require magento/product-community-edition=2.3.7 --no-update
151+
composer require-commerce magento/product-community-edition 2.4.1 --no-update
130152
```
131153
132154
### Example - Security patch
133155
134156
Security patches contain security fixes only. They are designed to make the upgrade process faster and easier.
135157
136-
Security patches use the Composer naming convention `2.3.6-px`. Use Composer to specify a patch. For example, to download the {{site.data.var.ce}} 2.3.6-p1 metapackage:
158+
Security patches use the Composer naming convention `2.4.x-px`. Use Composer to specify a patch. For example, to download the {{site.data.var.ce}} 2.4.3-p1 metapackage:
137159
138160
```bash
139-
composer require magento/product-community-edition=2.3.6-p1 --no-update
161+
composer require-commerce magento/product-community-edition 2.4.3-p1 --no-update
140162
```
141163
142164
## Update metadata

src/guides/v2.4/comp-mgr/trouble/current-search-engine.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ type='warning'
2929
content='If you have received this error, Magento is in an inconsistent state, and you cannot access the Admin. We recommend that you revert to your previous version of Magento while you resolve this error. To do this, run one of the following commands:
3030

3131
```bash
32-
composer require magento/product-enterprise-edition=<version>
32+
composer require-commerce magento/product-enterprise-edition=<version>
3333
```
3434

3535
```bash
36-
composer require magento/product-community-edition=<version>
36+
composer require-commerce magento/product-community-edition=<version>
3737
```
3838

3939
where `<version>` is the version of Magento you were running **before** the upgrade. For example, `2.3.5`.'

src/guides/v2.4/config-guide/deployment/single-machine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Contributing developers should use [this guide][6] to update their Magento insta
4040
1. Apply updates to Magento or its components using the following command pattern:
4141

4242
```bash
43-
composer require <package> <version> --no-update
43+
composer require-commerce <package> <version> --no-update
4444
```
4545

4646
**package**: The name of the package you want to update.

0 commit comments

Comments
 (0)