From 0af4572197561fbd119b62f9e7f90e40aa90b942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Votruba?= Date: Mon, 5 Dec 2016 01:52:03 +0100 Subject: [PATCH 1/2] Readme: fix code highlighting --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 75ee9c34..df91d120 100644 --- a/README.md +++ b/README.md @@ -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", @@ -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", @@ -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" @@ -79,7 +79,7 @@ There may be situations in which you want to ignore a patch supplied by a depend 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. -``` +```json { "require": { "cweagans/composer-patches": "~1.0", From b6a661553e59bebaefad5b6b776c9fac8886105a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Votruba?= Date: Mon, 5 Dec 2016 01:55:05 +0100 Subject: [PATCH 2/2] Readme: fix missed commas in json, fix list indentation --- README.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index df91d120..6588489b 100644 --- a/README.md +++ b/README.md @@ -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: ``` { @@ -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": { @@ -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": { @@ -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 @@ -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