neocosmo / composer-patch-repository
Apply patches to Composer packages from a repository.
Installs: 1 380
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
Type:composer-plugin
pkg:composer/neocosmo/composer-patch-repository
Requires
- php: >=5.3
- composer-plugin-api: ^2.0
- cweagans/composer-patches: ^1.7
Requires (Dev)
- composer/composer: ^2.0
This package is auto-updated.
Last update: 2025-12-26 10:36:23 UTC
README
This Composer plugin allows to install patches for other Composer packages from a repository.
Usage
Create a separate composer package (the patch repository), that will hold your patches for other Composer packages.
Install this package and the patch repository package in the Composer project where you want to apply the patches.
In the composer.json of your project add
"patch-repository": "foo/bar"under"extra", where foo/bar is the Composer package name of your patch repository.Add patches to your patch repository and run
composer update foo/baron your project to apply the patches to packages.
Now you can run composer require, composer update and composer install
and the plugin will always install the patches from the patch repository for
any applicable versions of packages.
Patch repository
The patch repository needs to follow a specific layout of its folders and files that looks as follows:
foo/
bar/
1.0/
00_foobar.patch
- foo is the vendor of a package.
- bar the project name of the package.
- 1.0 is the version constraint for the patch. The version constraints are always interpreted with the caret operator. So 1.0 from the example actually means ^1.0.
- 00_foobar.patch is the actual patch file. Patch files need the extension .patch and are applied in alphanumerical order. If patch files with the same name exist for multiple version constraints for a single package, then always the file from the most recent applicable version constraint is used. If such a patch file is empty, this patch is not applied.