Added support for the redefinition of PHP's internal functions.
Fixed: Correctly handle class instances.
Fixed: restoreAll() crashes with wildcards, multiple methods.
Autoloading is no longer used with Composer.
Wildcards are now supported, e.g.
replace('App\*', ...). Optional configuration files (
patchwork.json) are now used to blacklist/whitelist files for preprocessing, suppress warnings and specify a cache path. The cache used by Patchwork can now be primed by running
patchwork.phar from the command line.
redefine, restore[All] and relay are now the main aliases of replace, undo[All] and callOriginal.
Fixed: issues with . flock() 1.3.5
Wrapper-like behavior is now available to redefinitions using
Patchwork\callOriginal(). Preprocessor output is now optionally cached.
Patchwork\replaceLater is now a @deprecated alias to Patchwork\replace, which now performs an existence check when a redefinition is being undone, or on shutdown. HHVM is now supported.
No interference with opcode caches was detected.
Method redefinitions that are closures now have
$this bound to the method's object. 1.2.2
No errors are thrown anymore if an opcode cache is enabled.
An error is now thrown when including Patchwork.php if PHP version is lower than 5.3.0.
Fixed: Error thrown from call interception code in namespaced anonymous functions. Renamed public API functions:
patch → replace, unpatch → undo, escape → pass. Removed a specialized PHPUnit test case class.