} function callOriginal(array $args = null) { return Interceptor\callOriginal($args); } function undo(Interceptor\PatchHandle $handle) { $handle->removePatches(); } function undoAll() { Interceptor\unpatchAll(); } function enableCaching($location, $assertWritable = true) { Preprocessor\setCacheLocation($location, $assertWritable); } function blacklist($path) { Preprocessor\exclude($path); } if (Utils\runningOnHHVM()) { # no preprocessor needed on HHVM; # just let Patchwork become a wrapper for fb_intercept() register_shutdown_function('Patchwork\\undoAll'); return; } enableCaching(__DIR__ . '/cache', false); Preprocessor\Stream::wrap(); Preprocessor\attach(array(Preprocessor\Callbacks\Preprocessor\propagateThroughEval(), Preprocessor\Callbacks\Interceptor\injectCallInterceptionCode(), Preprocessor\Callbacks\Interceptor\injectScheduledPatchApplicationCode())); Preprocessor\onImport(array(Preprocessor\Callbacks\Interceptor\markPreprocessedFiles()));
{ $handle->removePatches(); } function undoAll() { Interceptor\unpatchAll(); } function silence(Interceptor\PatchHandle $handle) { $handle->silence(); } function enableCaching($location, $assertWritable = true) { Preprocessor\setCacheLocation($location, $assertWritable); } function blacklist($path) { Preprocessor\exclude($path); } if (Utils\runningOnHHVM()) { # no preprocessor needed on HHVM; # just let Patchwork become a wrapper for fb_intercept() register_shutdown_function('Patchwork\\undoAll'); return; } enableCaching(__DIR__ . '/cache', false); Preprocessor\Stream::wrap(); Preprocessor\attach(array(Preprocessor\Callbacks\Preprocessor\propagateThroughEval(), Preprocessor\Callbacks\Interceptor\injectCallInterceptionCode(), Preprocessor\Callbacks\Generic\injectTickingDeclaration())); Preprocessor\onImport(array(Preprocessor\Callbacks\Interceptor\markPreprocessedFiles())); register_tick_function('Patchwork\\Interceptor\\applyScheduledPatches'); Utils\clearOpcodeCaches();