kel / hooks
A simple php framework for adding runtime hooks to a system.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kel/hooks
Requires
- php: 5.6|^7.0
This package is not auto-updated.
Last update: 2025-12-21 12:09:35 UTC
README
A simple php framework for adding runtime hooks to a system.
installation
$ composer require kel/hooks
example
use Kel\Load; use Kel\Hooks; //create a new Hooks instance //passing an array of config options is optional //__NB: Multiple hooks can be added to the same hook point__ $hook = new Hooks(Load::config(__DIR__.'/config.php')); //add a hook init.php to the hook point init //the hook point is created if it does not exist $hook->add_hook('init', "init.php"); //add a hook init.php to the hook point final $hook->add_hook('final', "init.php"); //run the hook init $hook->run_hook('init'); //run the hook final $hook->run_hook('final');