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
If you don't want a patch package outside the root package, consider providing it as package in the [repositories key](https://getcomposer.org/doc/04-schema.md#repositories)
6
6
7
-
## Providing patches
7
+
```json
8
+
{
9
+
"name": "vendor/package",
10
+
"type": "project",
11
+
"repositories": [
12
+
{
13
+
"type": "package",
14
+
"package": {
15
+
"type": "metapackage",
16
+
"name": "vendor/package-patches",
17
+
"version": "1.0.0",
18
+
"require": {
19
+
"netresearch/composer-patches-plugin": "~1.0"
20
+
},
21
+
"extra": {
22
+
"patches": {
23
+
"vendor/name": [
24
+
{
25
+
"url": "https://my-domain.com/path/to/my.patch"
26
+
}
27
+
]
28
+
}
29
+
}
30
+
}
31
+
}
32
+
],
33
+
"require": {
34
+
"vendor/package-patches": "~1.0"
35
+
}
36
+
}
37
+
```
38
+
39
+
See this presentation for the original idea of this plugin: http://de.slideshare.net/christianopitz/distributed-patching-with-composer
8
40
9
-
You can provide the patches in any package through the extra object (you are free but don't have to bundle your patches in "patches" packages):
41
+
## Patch properties
42
+
43
+
Key | Description | Required
44
+
--- | --- | ---
45
+
``url`` | The url or path to the patch | ✓
46
+
``title`` | Title to display when applying or reverting the patch |
47
+
``args`` | string, which will be added to the patch command |
48
+
``sha1`` | SHA1 checksum of the patch contents for security check - when given the patches actual checksum and this value are compared and if they don't match an exception will be thrown |
49
+
50
+
You may provide patches per package and optionally by version constraints:
51
+
52
+
## Provide patches by package only
53
+
```json
54
+
{
55
+
"name": "netresearch/typo3-patches",
56
+
"version": "1.0.0",
57
+
"type": "metapackage",
58
+
"require": {
59
+
"netresearch/composer-patches-plugin": "~1.0"
60
+
},
61
+
"extra": {
62
+
"patches": {
63
+
"typo3/cms": [
64
+
{
65
+
"title": "[FEATURE] Allow registration of different login forms",
**Note**: *When multiple version constraints match the version of the target package, all of the matching patches will be applied (canonicalized by theyr checksums, so no duplicates should occure).*
123
+
124
+
## Provide patches from URLs or paths
125
+
126
+
You can put any part of the patches object into another JSON and load it via an URL (or a path):
@@ -112,36 +186,3 @@ just require the package with the patches.
112
186
}
113
187
}
114
188
```
115
-
116
-
If you don't want a patch package outside the root package, consider providing it as package in the [repositories key](https://getcomposer.org/doc/04-schema.md#repositories)
0 commit comments