Installation:
Add to composer.json:
"require": {
"dhorchler/sympatch-bundle": "dev-master"
}
Run:
composer update dhorchler/sympatch-bundle
Enable Bundle:
Register in app/AppKernel.php:
new DHorchler\SympatchBundle\DHorchlerSympatchBundle(),
Create Patch File:
Use Resources/patch/patches_examples.xml as a template.
Save your patch file as Resources/patch/patches_[name].xml.
First Use Case: List available patches:
php app/console patch --func=list
Patching Workflow:
Resources/patch/ (e.g., patches_custom.xml).<patch>
<file>src/Acme/DemoBundle/Controller/DefaultController.php</file>
<location type="line">42</location>
<patch>
<before>public function indexAction() { ... }</before>
<after>public function indexAction() { ... custom logic ... }</after>
</patch>
</patch>
Applying Patches:
php app/console patch --func=apply
php app/console patch --file=patches_custom.xml
Deactivating Patches:
composer update):
php app/console patch --func=disable
php app/console patch --func=enable
Vendor Patching:
vendor/symfony/symfony/src/Symfony/...)..org extension).Debugging Patches:
php app/console patch --func=apply --dry-run
Resources/patch/) to track changes across deployments.Discontinued Maintenance:
XML Complexity:
patches_examples.xml.<, >).File Permissions:
vendor/, src/)..org files) may fail if disk space is limited.Composer Conflicts:
composer update. Always:
--func=disable).--func=enable).Line Number Sensitivity:
--func=listall to confirm loaded patches before applying..org files for correctness if patches fail.php app/console patch --func=apply --verbose
Resources/patch/ location via config (if supported)..org files to a version control system.patches_fix_login_bug.xml).How can I help you explore Laravel packages today?