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
+82-71Lines changed: 82 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ A Drupal project usually consists of the following:
19
19
* Perhaps even some PHP libraries found on GitHub
20
20
* Custom code written by you and your team mates
21
21
22
-
The most popular approach to assembling these parts is using [Drush Make](http://drush.ws/docs/make.txt).
22
+
The most popular approach to assembling these parts is using [Drush Make](http://drush.ws/docs/make.txt).
23
23
24
24
Meanwhile the PHP Community has gathered around another dependency manager, [Composer](https://getcomposer.org/). It is even used for [managing dependencies for Drupal 8 Core](https://drupal.org/node/1764330).
25
25
@@ -51,34 +51,36 @@ The core version of Drupal to be used with the project is specified using the [C
51
51
52
52
Adding the following package to the `repositories` and `requires` sections will download Drupal 7.28 to the root of the Composer project:
Using Composer to manage Drupal projects has so far been tested with Drupal 7 projects. It may or may not work for Drupal 6 and 8.
@@ -99,10 +101,12 @@ All Drupal projects to be retrieved should be added as dependencies in the forma
99
101
The following will download the [Chaos tool suite (ctools)](https://drupal.org/project/ctools) module version 1.4 for Drupal 7.
100
102
101
103
102
-
```json
103
-
"require": {
104
-
"drupal/ctools": "7.1.4",
105
-
}
104
+
```json
105
+
{
106
+
"require": {
107
+
"drupal/ctools": "7.1.4"
108
+
}
109
+
}
106
110
```
107
111
108
112
The module will be placed under `sites/all/modules/contrib/`.
@@ -114,12 +118,14 @@ You can also run `php composer.phar require drupal/ctools` from the command line
114
118
Drupal projects are normally not available from the default Composer package repository Packagist. In order to for this to work a custom repository must be added:
115
119
116
120
```json
117
-
"repositories": [
118
-
{
119
-
"type": "composer",
120
-
"url": "http://packagist.drupal-composer.org"
121
-
}
122
-
]
121
+
{
122
+
"repositories": [
123
+
{
124
+
"type": "composer",
125
+
"url": "http://packagist.drupal-composer.org"
126
+
}
127
+
]
128
+
}
123
129
```
124
130
125
131
This repository is generated using the [drupal-parse-composer project](https://github.com/drupal-composer/drupal-parse-composer).
@@ -133,16 +139,18 @@ You specify the version of each project using [Composer package version constrai
133
139
134
140
In this example the following releases of Drupal 7 modules will be downloaded:
135
141
136
-
* Latest stable minor release of Chaos tool suite 1.x
142
+
* Latest stable minor release of Chaos tool suite 1.x
137
143
* Latest stable release of Features
138
144
* Latest development release of Views 3.x
139
145
140
-
```json
141
-
"require": {
142
-
"drupal/ctools": "7.1.*",
143
-
"drupal/features": "7.*"
144
-
"drupal/views": "7.3-dev",
145
-
}
146
+
```json
147
+
{
148
+
"require": {
149
+
"drupal/ctools": "7.1.*",
150
+
"drupal/features": "7.*",
151
+
"drupal/views": "7.3-dev"
152
+
}
153
+
}
146
154
```
147
155
148
156
#### Patch
@@ -154,6 +162,7 @@ To apply a patch to a project a `patches` section must be added to the `extras`
154
162
The following will patch the Chaos tool suite version 7.1.4 with [this patch](https://drupal.org/files/issues/ctools-deleted-not-needed-element-from-array-in-node-plugin.patch):
155
163
156
164
```json
165
+
{
157
166
"repositories": [
158
167
{
159
168
"type": "package",
@@ -180,9 +189,10 @@ The following will patch the Chaos tool suite version 7.1.4 with [this patch](ht
180
189
}
181
190
],
182
191
"require": {
183
-
"netresearch/composer-patches-plugin": "~1.0"
192
+
"netresearch/composer-patches-plugin": "~1.0",
184
193
"reload/drupal-composer-project-patches": "*"
185
194
}
195
+
}
186
196
```
187
197
188
198
The important parts about a package containing patches are:
@@ -206,12 +216,14 @@ The plugin does not generate a `PATCHES.txt` file for each patched project as Dr
206
216
The location of projects can be changed in the `installer-paths` section of `composer.json` either by individual project or by type.
0 commit comments