Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme: fix code highlighting #87

Merged
merged 2 commits into from
Dec 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Simple patches plugin for Composer. Applies a patch from a local or remote file

Example composer.json:

```
```json
{
"require": {
"cweagans/composer-patches": "~1.0",
Expand All @@ -30,7 +30,7 @@ Example composer.json:

Instead of a patches key in your root composer.json, use a patches-file key.

```
```json
{
"require": {
"cweagans/composer-patches": "~1.0",
Expand All @@ -46,7 +46,7 @@ Instead of a patches key in your root composer.json, use a patches-file key.

```

Then your composer.patches.json should look like this:
Then your `composer.patches.json` should look like this:

```
{
Expand All @@ -62,7 +62,7 @@ Then your composer.patches.json should look like this:

If you want your project to accept patches from dependencies, you must have the following in your composer file:

```
```json
{
"require": {
"cweagans/composer-patches": "^1.5.0"
Expand All @@ -72,18 +72,21 @@ If you want your project to accept patches from dependencies, you must have the
}
}
```

## Ignoring patches

There may be situations in which you want to ignore a patch supplied by a dependency. For example:
1. You use a different more recent version of a dependency, and now a patch isn't applying.
1. You have a more up to date patch than the dependency, and want to use yours instead of theirs.
1. A dependency's patch adds a feature to a project that you don't need.
1. Your patches conflict with a dependency's patches.

```
- You use a different more recent version of a dependency, and now a patch isn't applying.
- You have a more up to date patch than the dependency, and want to use yours instead of theirs.
- A dependency's patch adds a feature to a project that you don't need.
- Your patches conflict with a dependency's patches.

```json
{
"require": {
"cweagans/composer-patches": "~1.0",
"drupal/drupal": "~8.2"
"drupal/drupal": "~8.2",
"drupal/lightning": "~8.1"
},
"config": {
Expand All @@ -94,7 +97,7 @@ There may be situations in which you want to ignore a patch supplied by a depend
"drupal/drupal": {
"Add startup configuration for PHP server": "https://www.drupal.org/files/issues/add_a_startup-1543858-30.patch"
}
}
},
"patches-ignore": {
"drupal/lightning": {
"drupal/panelizer": {
Expand All @@ -105,11 +108,12 @@ There may be situations in which you want to ignore a patch supplied by a depend
}
}
```

## Using patches from HTTP URLs

Composer [blocks](https://getcomposer.org/doc/06-config.md#secure-http) you from downloading anything from HTTP URLs, you can disable this for your project by adding a ```secure-http``` setting in the config section of your composer.json. Note that the ```config``` section should be under the root of your composer.json.
Composer [blocks](https://getcomposer.org/doc/06-config.md#secure-http) you from downloading anything from HTTP URLs, you can disable this for your project by adding a `secure-http` setting in the config section of your `composer.json`. Note that the `config` section should be under the root of your `composer.json`.

```
```json
{
"config": {
"secure-http": false
Expand All @@ -127,10 +131,10 @@ To enforce throwing an error and stopping package installation/update immediatel

## Difference between this and netresearch/composer-patches-plugin

* This plugin is much more simple to use and maintain
* This plugin doesn't require you to specify which package version you're patching
* This plugin is easy to use with Drupal modules (which don't use semantic versioning).
* This plugin will gather patches from all dependencies and apply them as if they were in the root composer.json
- This plugin is much more simple to use and maintain
- This plugin doesn't require you to specify which package version you're patching
- This plugin is easy to use with Drupal modules (which don't use semantic versioning).
- This plugin will gather patches from all dependencies and apply them as if they were in the root composer.json

## Credits

Expand Down