There is a hook class under the Library/think in the TP framework, which is used to instantiate classes and execute methods in the form of plug-ins.
static Private $tags = Array ();
Here is a static private member, here is the so-called hook function array, inside the specific content is an array
Array format: Arrays (' Method name ' =>array (class name, class name), ' method name ' =>array (class name))
Of course, in a single-instance design pattern, it is undoubtedly best to access these static members in a static way, so the get method of TP
It's a good illustration of the situation.
The following method of the Add plugin
This is the first to determine whether the method tag is first created, if it is a static zone array with a key value is the tag value, value is an empty array, and then compatible with the 2 write mode, one is the name array is a string form, is not intended to construct the above I said
That plug-in array
What's strange about this is that his EXE method doesn't do any of the class existence and method existence judgment here, it feels weird.
On the analysis of hook hooks in thinkphp