Intro
First of all, what is "monkey patch"? As Wiki says "A monkey patch is a way to extend or modify the run-time code of dynamic languages without altering the original source code." (see Monkey patch article for reference).
What for?
Forwardport doctrine (see #1932290: Forwardport doctrine - a proposed solution for Drupal major version migration problem) stuck on huge problem: we can't override any function (or constant) definition, but it is necessary for our purposes. For example, some of the constants defined in D6 differ from defined in D7, though their name are the same. What we need is to override once defined constant - but we can't till present.
Proposal
Use patchwork library.
It opens the door for such innovations as:
- Continue to develop Forwardport doctrine at completely new level.
- Provide Features functionality for regular modules' and even core source code (can you imagine?). See corresponding Patch Manager issue: #2004462: Switch to monkey patching instead of dealing with source code directly.
Solution
Depend on patchwork as a library (using Libraries module).
Comments
Comment #1
PatchRanger commentedDone: