fhaase / composer-patches-generate
Command to create composer patches via cli
Package info
github.com/haase-fabian/composer-patches-generate
pkg:composer/fhaase/composer-patches-generate
v0.1.1
2026-04-09 12:13 UTC
Requires
- php: >=8.0
- symfony/console: >=5.4
- symfony/polyfill-php84: ^1.33
- symfony/process: >=5.4
Suggests
- cweagans/composer-patches: To apply patches during composer install
README
Introduction
A standalone command-line utility to generate patches for cweagans/composer-patches.
Effortlessly capture local modifications to Composer dependencies, commit them to your project, and ensure your custom fixes are reliably applied across all environments during composer install.
Install
Make sure git and find are installed.
git version -> git version 1.51.0 find --version -> find (GNU findutils) 4.10.0-dirty
composer require --dev fhaase/composer-patches-generate
# Recommended to apply patches on install
composer require cweagans/composer-patches
Usage
Generate or update patch files
- Create a copy of a file with
*.oldsuffix inside one of the composer packages - Modify the original file
There should now be files like this:UserFactory.php UserFactory.php.old - Run the command with the package name
vendor/bin/composer-patches-generate vendor/example - When prompted, you can give a short description to generate configuration for
cweagans/composer-patches\{ "extra": { "patches": { "vendor/example": { "<description>": "patches/vendor_example/UserFactory.patch" } } } } - Repeat Step 3 to update the patches when further changes are necessary.