It has some documentation inside the files, but here's a short manual:
in the code at the place where you'd want some code to hook in (called an "entry point"):
- Create a WEnvironment and set the desired variables.
- set the entry point: Yii::app()->hookManager->entryPoint('EntryPointName', $environment)
A hook function can be a php callback of the forms:
- WMyHook (= a class which extends WHook);
A hook can be registered with:
- at runtime: Yii::app()->hookManager->registerHook($hook, $save); // set $save to true to save in the config file
// and never need to call this function again.
- in the config file at protected/config/hooks.php
see the code for details about this.
Just copy these files to a place where they can be automatically loaded, like protected/components
Could or should this be part of the core framework?
Leave your thoughts about this below.
If you people think this should become an enhancement to the framework I'll create a ticket on google projects.