dev-master
9999999-devSymfony2 code patch tool
The Requires
- php >=5.3.3
- symfony/framework-bundle >=2.1.0,<3.0
by Detlef Horchlerl
Symfony2 code patch tool
Symfony2 code patch tool, (*1)
This bundle has been discontinued, (*2)
DHorchlerSympatchBundle consists in a tool that enables you to patch code parts anywhere in your Symfony project (including vendors). It even lets you extend foreign (vendors) entities!, (*3)
Allows you to send minor code changes to your customers in just a single XML-file!, (*4)
Let Composer download and install the bundle by first adding it to your composer.json, (*5)
{ "require": { "dhorchler/sympatch-bundle": "dev-master" } }
and then running, (*6)
php composer.phar update dhorchler/sympatch-bundle
in app/AppKernel.php, (*7)
public function registerBundles() { $bundles = array( // ... new DHorchler\SympatchBundle\DHorchlerSympatchBundle(), ); // ... }
use example file at Ressources/patch/patches_examples.xml to create your patch files keeping the XML structure of that file. Sympatch will look for files Ressources/patch/patches_*.xml to load the patches., (*8)
php app/console patch --func=list php app/console patch --func=listall php app/console patch --func=update php app/console patch --func=deactivateall
when specifying code locations in <beforecode> or <aftercode> tags, copy complete lines from the target source file(s) to the xml file, (*9)
by running the tests any patch file in /Resources/patch like patches_.xml is temporarily renamed to patches_.xml.unittest, (*10)
the use of <beforecode>, <aftercode> is encouraged over <beforeline>, <afterline> for two reasons: more than one patch in the same file will not cause problems of keeping track of line numbers because of line shifts caused by each patch. generally, chances are better to have patches working after code base upgrades without modifications., (*11)
the deactivateall command has been added to allow code base upgrades without version collisions. It will deactivate all patches disregarding the status that each patch has in the patch files. The sequence would be:, (*12)
when you send code patches to others, mark the patch file(s) as not processed (<processed>no</processed>). The receiver will have to copy the xml-files to Resources/patch and then restart his application. During the restart Sympatch will look for non processed patch files, process them (onKernelRequest trigger) and mark them as processed., (*13)
Symfony2 code patch tool