Skip to content

V1.3 adds tests and delete patches methods

Rich requested to merge v1.3 into master

Created by: artfulrobot

This is a preferred approach over https://github.com/artfulrobot/patchwork/pull/2

From README:

  • Progammatically: call
    \Civi\Patchwork::deletePatch('/CRM/Mailing/MailStore.php') which will delete a patch for that core file. This can be useful in extension Upgrader classes for example, to ensure your new patch logic is applied.

  • Progammatically: call \Civi\Patchwork::deletePatches() which will delete all patches. This could feasibly be useful if you were worried about old patch files kicking around; say a patched version of something that a now-deleted/disabled extension created.

Example use: you maintain an extension that patches a file and you have a new patching method

Before this PR, patchwork would not know to recretate the patch.

With this PR, your extension can implement the Upgrader class pattern and include one of the calls above to ensure that the files get re-patched.

During development, you can add calls to that code somewhere in an early-firing hook, so it's repatched every runtime.

@mattwire

Merge request reports