public function __construct()
{
$CFG =& load_class('Config', 'core');
log_message('info', 'Hooks Class Initialized');
// If hooks are not enabled in the config file
// there is nothing else to do
if ($CFG->item('enable_hooks') === FALSE) {
return;
}
// Grab the "hooks" definition file.
if (file_exists(APPPATH . 'config/hooks.php')) {
include APPPATH . 'config/hooks.php';
}
if (file_exists(APPPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
include APPPATH . 'config/' . ENVIRONMENT . '/hooks.php';
}
// If there are no hooks, we're done.
if (!isset($hook) or !is_array($hook)) {
return;
}
$this->hooks =& $hook;
$this->enabled = TRUE;
}