CI_Hooks::__construct PHP Method

__construct() public method

Class constructor
public __construct ( ) : void
return void
    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;
    }

Usage Example

 /**
  * @method __construct
  * @param string/int $init - user id or email of user to load      
  * @access public    
  * @return none
  */
 public function __construct($init = false)
 {
     parent::__construct();
     $this->CI =& get_instance();
     $this->CI->load->library('session');
     $this->CI->load->helper(array('form', 'url', 'cookie'));
 }
All Usage Examples Of CI_Hooks::__construct