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: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,21 @@ The new version continues to support parsing the unique repository configuration
106
106
107
107
The `username` and `password` can be specified in the `auth.json` file on a per-user basis with the [authentication mechanism provided by Composer](https://getcomposer.org/doc/articles/http-basic-authentication.md).
108
108
109
+
### Global configuration
110
+
It's also possible to add some configuration inside global `composer.json` located at composer home (`composer config -g home`).
111
+
112
+
Following precedence order will be used for each key:
113
+
- command-line parameter
114
+
- local`composer.json`
115
+
- global `composer.json`
116
+
- default
117
+
118
+
Array values will not be merged.
119
+
120
+
The command-line parameter -- repository is required iflocal configuration is multi repository. Global unique repository configuration will be ignored in that case.
121
+
122
+
Multi repository configuration will be merged by the `name` key.
if (empty($repository) && !empty($localConfig[0])) {
306
+
thrownew \InvalidArgumentException('As configurations in composer.json support upload to multi repository, the option --repository is required');
307
+
}
308
+
if (!empty($repository) && empty($globalConfig[0]) && empty($localConfig[0])) {
309
+
thrownewInvalidConfigException('the option --repository is offered, but configurations in composer.json doesn\'t support upload to multi repository, please check');
if (empty($repository) && (!empty($extras['push'][0]) || !empty($extras['nexus-push'][0]))) {
330
-
thrownew \InvalidArgumentException('As configurations in composer.json support upload to multi repository, the option --repository is required');
335
+
if (empty($extras[0])) {
336
+
returnnull;
331
337
}
332
-
if (!empty($repository) && empty($extras['push'][0]) && empty($extras['nexus-push'][0])) {
333
-
thrownewInvalidConfigException('the option --repository is offered, but configurations in composer.json doesn\'t support upload to multi repository, please check');
338
+
339
+
foreach ($extrasas$key => $repository) {
340
+
if (empty($repository[self::PUSH_CFG_NAME])) {
341
+
$fmt = 'The push configuration array in composer.json with index {%s} needs to provide the value for key "%s"';
0 commit comments