You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/class_descriptions.md
+31-7Lines changed: 31 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,9 +64,11 @@ Extends the native [RequireCommand](https://getcomposer.org/apidoc/master/Compos
64
64
-**`setApplication()`**
65
65
- Overrides the command's name to `require` after the command registry is checked but before the command is actually added to the registry. This allows the command to replace the native `RequireCommand` instance that is normally associated with the `composer require` CLI command
66
66
-**`execute()`**
67
-
- Wraps the native `RequireCommand::execute()` function with the Magento project update code if a Magento product package is found in the command's parameters
67
+
- Wraps the native `RequireCommand::execute()` function with the Magento project update code
68
68
-**`runUpdate()`**
69
69
- Calls [MagentoRootUpdater::runUpdate()](#magentorootupdater) after processing CLI options
70
+
-**`parseMagentoRequirement()`**
71
+
- Parses the CLI command arguments for a magento/product requirement
@@ -132,6 +134,8 @@ This class manages the plugin's self-installation inside the `var` directory to
132
134
- Called by `composer magento-update-plugin install` and the Magento module setup classes ([InstallData](#installdatarecurringdataupgradedata), [RecurringData](#installdatarecurringdataupgradedata), [UpgradeData](#installdatarecurringdataupgradedata))
133
135
-**`updateSetupWizardPlugin()`**
134
136
- Installs the plugin inside `var/vendor` where it can be found by the `composer require` command run by the Web Setup Wizard's validation check. This is accomplished by creating a dummy project directory with a `composer.json` file that requires only the plugin, installing it, then copying the resulting `vendor` directory to `var/vendor`
137
+
-**`getTempDir()`**
138
+
- Creates a temporary directory inside the `var` directory to use for the dummy plugin project in `updateSetupWizardPlugin()`
135
139
-**`deletePath()`**
136
140
- Recursively deletes a file or directory and all its contents
137
141
-**`copyAndReplace()`**
@@ -155,15 +159,27 @@ This is accomplished by comparing `composer.json` fields between the original Ma
155
159
- Entry point into the resolution functionality
156
160
- Calls the relevant resolve function for each `composer.json` field that can be updated
157
161
-**`findResolution()`**
158
-
- For an individual field value, compare the original Magento value to the target Magento value, and if a delta is found, check if the user's installation has a customized value for the field. If the user has changed the value, resolve the conflict according to the CLI command options: use the user's custom value, override with the target Magento value, or interactively ask the user which of the two values should be used
162
+
- For an individual field value, compare the original Magento value to the target Magento value, and if a delta is found, check if the user's installation has a customized value for the field then apply the appropriate resolution
163
+
-**`prettify()`**
164
+
- Formats a field value to be human-readable if a preset pretty value is not present
165
+
-**`solveIfConflict()`**
166
+
- If the user has a field value that conflicts with an expected delta, resolve the conflict according to the CLI command options: use the user's custom value, override with the target Magento value, or interactively ask the user which of the two values should be used
159
167
-**`resolveLinkSection()`**
160
168
- For a given `composer.json` section that consists of links to package versions/constraints (such as the `require` and `conflict` sections), call `findLinkResolution()` for each package constraint found in either the original Magento root or the target Magento root
169
+
-**`resolveLink()`**
170
+
- Helper function to call `findResolution()` for a particular package for use by `resolveLinkSection()`
171
+
-**`getConstraintValues()`**
172
+
- Helper function to get the raw and pretty forms of a link for comparison
173
+
-**`applyLinkChanges()`**
174
+
- Adjust the json values for a link section according to the resolutions calculated by `resolveLinkSection()`
161
175
-**`resolveArraySection()`**
162
176
- For a given `composer.json` section that consists of data that is not package links (such as the `"autoload"` or `"extra"` sections), call `resolveNestedArray()` and accept the new values if changes were made
163
177
-**`resolveNestedArray()`**
164
178
- Recursively processes changes to a `composer.json` value that could be a nested array, calling `findResolution()` for each "leaf" value found in either the original Magento root or the target Magento root
165
-
-**`findLinkResolution()`**
166
-
- Helper function to call `findResolution()` for a particular package for use by `resolveLinkSection()`
179
+
-**`resolveFlatArray()`**
180
+
- Process changes to the non-associative portion of an array field value, treating it as an unordered set
181
+
-**`resolveAssociativeArray()`**
182
+
- Process changes to the associative portion of an array field value that could contain nested arrays
167
183
-**`getLinkOrderOverride()`**
168
184
- Determine the order to use for a link section when the user's order disagrees with the target Magento section order
169
185
-**`buildLinkOrderComparator()`**
@@ -190,10 +206,12 @@ This class contains methods to retrieve Composer [Package](https://getcomposer.o
190
206
- Returns the existing root project package, including all user customizations
191
207
-**`fetchMageRootFromRepo()`**
192
208
- Given a Magento edition and version constraint, fetch the best-fit Magento root project package from the Composer repository
193
-
-**`parseOriginalVersionAndEditionFromLock()`**
209
+
-**`parseVersionAndEditionFromLock()`**
194
210
- Inspect the `composer.lock` file for the currently-installed Magento product package and parse out the edition and version for use by `getOriginalRootPackage()`
195
-
-**`getRootLocker()`**
196
-
- Helper function to get the [Locker](https://getcomposer.org/apidoc/master/Composer/Package/Locker.html) object for the `composer.lock` file in the project root directory. If the current working directory is `var` (which is the case for the Web Setup Wizard), instead use the `composer.lock` file in the parent directory
211
+
-**`getTargetLabel()`**
212
+
- Gets the formatted label for the target Magento version
213
+
-**`getOriginalLabel()`**
214
+
- Gets the formatted label for the originally-installed Magento version
197
215
198
216
***
199
217
@@ -222,7 +240,13 @@ Common package-related utility functions.
222
240
- Extracts the package type (`product` or `project`) from a Magento package name
223
241
-**`getMagentoProductEdition()`**
224
242
- Extracts the package edition from a Magento product package name
243
+
-**`getEditionLabel()`**
244
+
- Translates package edition into the marketing edition label
225
245
-**`findRequire()`**
226
246
- Searches the `"require"` section of a [Composer](https://getcomposer.org/apidoc/master/Composer/Composer.html) object for a package link that fits the supplied name or matcher
227
247
-**`isConstraintStrict()`**
228
248
- Checks if a version constraint is strict or if it allows multiple versions (such as `~1.0` or `>= 1.5.3`)
249
+
-**`getLockedProduct()`**
250
+
- Gets the installed magento/product package from the composer.lock file if it exists
251
+
-**`getRootLocker()`**
252
+
- Helper function to get the [Locker](https://getcomposer.org/apidoc/master/Composer/Package/Locker.html) object for the `composer.lock` file in the project root directory. If the current working directory is `var` (which is the case for the Web Setup Wizard), instead use the `composer.lock` file in the parent directory
Copy file name to clipboardExpand all lines: docs/process_flows.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,17 +30,18 @@ There are four paths through the plugin code that cover two main pieces of funct
30
30
2. Composer recognizes `require` as the command passed to the executable and finds `MageRootRequireCommand` as the command object registered under that name
4.`MageRootRequireCommand::execute()` backs up the user's `composer.json` file through [ExtendableRequireCommand::parseComposerJsonFile()](class_descriptions.md#extendablerequirecommand)
33
-
5.`MageRootRequireCommand::execute()` checks the `composer require` arguments for a `magento/product` package, and if it finds one it calls `MageRootRequireCommand::runUpdate()`
8.`DeltaResolver::resolveRootDeltas()` uses [RootPackageRetriever](class_descriptions.md#rootpackageretriever) to obtain the Composer [Package](https://getcomposer.org/apidoc/master/Composer/Package/Package.html) objects for the root `composer.json` files from the default installation of the existing edition and version, the target edition and version supplied to the `composer require` call, and the user's current installation including any customizations they have made
37
-
9.`DeltaResolver::resolveRootDeltas()` iterates over the fields in `composer.json` to determine any values that need to be updated to match the root `composer.json` file of the new Magento edition/version
6.`MageRootRequireCommand::runUpdate()` calls `MageRootRequireCommand::parseMageRequirement()` to check the `composer require` arguments for a `magento/product` package
35
+
7. If a `magento/product` package is found in the command arguments, it calls [MagentoRootUpdater::runUpdate()](class_descriptions.md#magentorootupdater)
9.`DeltaResolver::resolveRootDeltas()` uses [RootPackageRetriever](class_descriptions.md#rootpackageretriever) to obtain the Composer [Package](https://getcomposer.org/apidoc/master/Composer/Package/Package.html) objects for the root `composer.json` files from the default installation of the existing edition and version, the target edition and version supplied to the `composer require` call, and the user's current installation including any customizations they have made
38
+
10.`DeltaResolver::resolveRootDeltas()` iterates over the fields in `composer.json` to determine any values that need to be updated to match the root `composer.json` file of the new Magento edition/version
38
39
1. To find these values, it compares the values for each field in the default project for the installed edition/version with the project for the target edition/version (`DeltaResolver::findResolution()`)
39
40
2. If a value has changed in the target, it checks that field in the user's customized root `composer.json` file to see if it has been overwritten with a custom value
40
41
3. If the user customized the value, the conflict will be resolved according to the specified resolution strategy: use the expected Magento value, use the user's custom value, or prompt the user to specify which value should be used
41
-
10. If `resolveRootDeltas()` found values that need to change, `MageRootRequireCommand::execute()` calls `MagentoRootUpdater::writeUpdatedComposerJson()` to apply those changes
42
-
11.`MageRootRequireCommand::execute()` calls the native `RequireCommand::execute()` function, which will now use the updated root `composer.json` file if the plugin made changes
43
-
12. If the `RequireCommand::execute()` call fails after the plugin makes changes, `MageRootRequireCommand::execute()` calls `ExtendableRequireCommand::revertMageComposerFile()` to restore the `composer.json` file to its original state
42
+
11. If `resolveRootDeltas()` found values that need to change, `MageRootRequireCommand::runUpdate()` calls `MagentoRootUpdater::writeUpdatedComposerJson()` to apply those changes
43
+
12.`MageRootRequireCommand::execute()` calls the native `RequireCommand::execute()` function, which will now use the updated root `composer.json` file if the plugin made changes
44
+
13. If the `RequireCommand::execute()` call fails after the plugin makes changes, `MageRootRequireCommand::execute()` calls `ExtendableRequireCommand::revertMageComposerFile()` to restore the `composer.json` file to its original state
0 commit comments