Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 80 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,35 @@ The core version of Drupal to be used with the project is specified using the [C
Adding the following package to the `repositories` and `requires` sections will download Drupal 7.28 to the root of the Composer project:

```json
"repositories": [
{
"type": "package",
"package": {
"name": "drupal/drupal",
"type": "non-destructive-archive-installer",
"version": "7.28",
"dist": {
"url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
"type": "zip"
},
"require": {
"azt3k/non-destructive-archive-installer" : "*"
},
"extra": {
"target-dir": ".",
"omit-first-directory": "true"
},
"replace": {
}
}
}
],
"require": {
"azt3k/non-destructive-archive-installer" : "0.2.*",
"drupal/drupal": "7.*",
}
{
"repositories": [
{
"type": "package",
"package": {
"name": "drupal/drupal",
"type": "non-destructive-archive-installer",
"version": "7.28",
"dist": {
"url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
"type": "zip"
},
"require": {
"azt3k/non-destructive-archive-installer" : "*"
},
"extra": {
"target-dir": ".",
"omit-first-directory": "true"
},
"replace": {
}
}
}
],
"require": {
"azt3k/non-destructive-archive-installer" : "0.2.*",
"drupal/drupal": "7.*"
}
}
```

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.
Expand All @@ -100,9 +102,11 @@ The following will download the [Chaos tool suite (ctools)](https://drupal.org/p


```json
"require": {
"drupal/ctools": "7.1.4",
}
{
"require": {
"drupal/ctools": "7.1.4"
}
}
```

The module will be placed under `sites/all/modules/contrib/`.
Expand All @@ -114,12 +118,14 @@ You can also run `php composer.phar require drupal/ctools` from the command line
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:

```json
"repositories": [
{
"type": "composer",
"url": "http://packagist.drupal-composer.org"
}
]
{
"repositories": [
{
"type": "composer",
"url": "http://packagist.drupal-composer.org"
}
]
}
```

This repository is generated using the [drupal-parse-composer project](https://github.com/drupal-composer/drupal-parse-composer).
Expand All @@ -138,11 +144,13 @@ In this example the following releases of Drupal 7 modules will be downloaded:
* Latest development release of Views 3.x

```json
"require": {
"drupal/ctools": "7.1.*",
"drupal/features": "7.*"
"drupal/views": "7.3-dev",
}
{
"require": {
"drupal/ctools": "7.1.*",
"drupal/features": "7.*",
"drupal/views": "7.3-dev"
}
}
```

#### Patch
Expand All @@ -154,6 +162,7 @@ To apply a patch to a project a `patches` section must be added to the `extras`
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):

```json
{
"repositories": [
{
"type": "package",
Expand All @@ -180,9 +189,10 @@ The following will patch the Chaos tool suite version 7.1.4 with [this patch](ht
}
],
"require": {
"netresearch/composer-patches-plugin": "~1.0"
"netresearch/composer-patches-plugin": "~1.0",
"reload/drupal-composer-project-patches": "*"
}
}
```

The important parts about a package containing patches are:
Expand All @@ -206,12 +216,14 @@ The plugin does not generate a `PATCHES.txt` file for each patched project as Dr
The location of projects can be changed in the `installer-paths` section of `composer.json` either by individual project or by type.

```json
"extra": {
"installer-paths": {
"sites/all/modules/contrib/{$name}/": ["type:drupal-module"],
"sites/all/themes/{$name}/": ["drupal/zen"]
}
{
"extra": {
"installer-paths": {
"sites/all/modules/contrib/{$name}/": ["type:drupal-module"],
"sites/all/themes/{$name}/": ["drupal/zen"]
}
}
}
```

Custom location of packages are handled by [the Composer Installers project](https://github.com/composer/installers).
Expand Down Expand Up @@ -263,27 +275,27 @@ Non-Drupal non-Composer libraries can be retrieved by specifying them as custom
Example downloading jQuery UI 1.10.4:

```json
{
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jqueryui",
"version": "1.10.4",
"type": "drupal-library",
"dist": {
"url": "http://jqueryui.com/resources/download/jquery-ui-1.10.4.zip",
"type": "zip"
},
"require": {
"composer/installers": "~1.0",
}
}
}
],
"require": {
"jquery/jquery.ui": "1.10.4",
}
{
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jqueryui",
"version": "1.10.4",
"type": "drupal-library",
"dist": {
"url": "http://jqueryui.com/resources/download/jquery-ui-1.10.4.zip",
"type": "zip"
},
"require": {
"composer/installers": "~1.0"
}
}
}
],
"require": {
"jquery/jquery.ui": "1.10.4"
}
}
```

Expand Down