diff options
author | admin <devnull@localhost> | 2006-09-15 22:02:05 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-15 22:02:05 +0200 |
commit | 764672b45108814fc643be65b53b18f0b6507112 (patch) | |
tree | bc82882b11e460b7407a5204b1fa346a95b62929 /system/libraries | |
parent | eb567c702cda744b53be22206c55a960a36cb678 (diff) |
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Hooks.php | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php index 389e7ac14..7ff0592ff 100644 --- a/system/libraries/Hooks.php +++ b/system/libraries/Hooks.php @@ -69,34 +69,6 @@ class CI_Hooks { // -------------------------------------------------------------------- /** - * Does a given hook exist? - * - * Returns TRUE/FALSE based on whether a given hook exists - * - * @access private - * @param string - * @return bool - */ - function _hook_exists($which = '') - { - if ( ! $this->enabled) - { - return FALSE; - } - - if ( ! isset($this->hooks[$which])) - { - return FALSE; - } - - return TRUE; - } - // END hook_exists() - - - // -------------------------------------------------------------------- - - /** * Call Hook * * Calls a particular hook @@ -107,6 +79,11 @@ class CI_Hooks { */ function _call_hook($which = '') { + if ( ! $this->enabled OR ! isset($this->hooks[$which])) + { + return FALSE; + } + if (isset($this->hooks[$which][0]) AND is_array($this->hooks[$which][0])) { foreach ($this->hooks[$which] as $val) @@ -118,6 +95,8 @@ class CI_Hooks { { $this->_run_hook($this->hooks[$which]); } + + return TRUE; } // END hook_exists() @@ -144,7 +123,7 @@ class CI_Hooks { // ----------------------------------- // If the script being called happens to have the same - // extension call within it a loop can happen + // hook call within it a loop can happen if ($this->in_progress == TRUE) { |