jpstacey/composer-patcher

There is no license information available for the latest version (1.1.0) of this package.

Runs patches against projects after install

Installs: 52

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 4

Forks: 1

Open Issues: 0

Type:composer-plugin

1.1.0 2014-08-26 20:21 UTC

This package is not auto-updated.

Last update: 2024-11-09 16:37:42 UTC


README

The project jpstacey/composer-patcher is now deprecated in favour of netresearch/composer-patches-plugin.

Please update your composer.json files accordingly.

Old documentation, for reference

Plugin to patch composer downloads post-hoc.

Arguably you wouldn't want to do this, if you could avoid it. But it's the way that a lot of existing drupal.org patch workflow happens (especially via Drush make) and so this provides a useful transition technology.

Minimum composer.json

The package is now registered on Packagist:

https://packagist.org/packages/jpstacey/composer-patcher

so you should only require the following minimum JSON:

{
    "require": {
        "jpstacey/composer-patcher": "*"
    },
    "scripts": {
        "post-package-install": "Composer\\Patcher\\PatcherPlugin::postPackageInstall"
    }
}

The "scripts" is required in your root composer.json as it will not run in a subsidiary composer.json for security reasons.

Example composer.json

Downloads and patches a Drupal module:

{
    "repositories": {
        "xmlsitemap": {
            "type": "package",
            "package": {
                "name": "drupal/xmlsitemap",
                "type": "drupal-module",
                "version": "2.0-rc2",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/xmlsitemap-7.x-2.0-rc2.tar.gz",
                    "type": "tar"
                },
                "extra": {
                    "patch": [
                        "https://drupal.org/files/include_inc_file-1392710.patch"
                    ]
                }
            }
        }
    },
    "require": {
        "jpstacey/composer-patcher": "*",
        "drupal/xmlsitemap": "2.0-rc2"
    },
    "scripts": {
        "post-package-install": "Composer\\Patcher\\PatcherPlugin::postPackageInstall"
    }
}