conduit-innovation / gorilla-claw Goto Github PK
View Code? Open in Web Editor NEWWordPress action / filter runtime toolkit library, with monkey-patching capabilities.
License: MIT License
WordPress action / filter runtime toolkit library, with monkey-patching capabilities.
License: MIT License
It makes sense to me that developers will need to perf check any hooks they monkey-patch in some way.
It would be nice to include a basic API for this. Perhaps something like:
define('GORILLA_PROFILE', true);
/* Do something with hooks */
gorillaclaw_perf_report();
Feature criteria:
Cannot access the original scope / $this
from within injected handlers.
$hooks->inject(function($input) {
$this->{'id'} = 1;
return $input . '-before-' . $this->{'get_private_id'}();
}, function($input) {
$this->{'id'} = 2;
return $input . '-after-' . $this->{'get_id'}();
});
Throws: Error: Call to undefined method GorillaClaw\Test\HookTest::get_private_id()
It should be possible to intercept calls / accesses made by a handler to $this
, without replacing the original handler.
This means we can register on_call
type events that are fired when a filter / action handler tries to access it's own $this
. We can then either return a new value to skip execution of the $this->some_method()
call, or return null
to allow the call to continue.
This is a huge rabbit hole, and will need some thought. In theory we could pre and post process any object accessor similar to how we inject()
.
HookProxy
works (ie. proxying-a-proxy should proxy the original object)Branch feature/intercept tracks this feature.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.