Permalink
Browse files

Fixed _call_hook in CodeIgniter class and test

Signed-off-by: dchill42 <dchill42@gmail.com>
  • Loading branch information...
1 parent 3fe0080 commit bbd3b98bb144bc2bcc7c0a0d3b9b70a236e79507 @dchill42 committed Sep 25, 2012
Showing with 11 additions and 11 deletions.
  1. +7 −7 system/core/CodeIgniter.php
  2. +4 −4 tests/codeigniter/core/CodeIgniter_test.php
@@ -611,7 +611,7 @@ protected function _load_base()
// Load the hooks class and call pre_system (depends on Config)
$this->load_core_class('Hooks');
- $this->hooks->_call_hook('pre_system');
+ $this->hooks->call_hook('pre_system');
// Load Loader as 'load' (depends on Config)
$this->load_core_class('Loader', 'load');
@@ -654,7 +654,7 @@ protected function _load_routing()
}
// Is there a valid cache file? If so, we're done...
- if ($this->hooks->_call_hook('cache_override') === FALSE && $this->output->_display_cache() === TRUE)
+ if ($this->hooks->call_hook('cache_override') === FALSE && $this->output->_display_cache() === TRUE)
{
$this->_display_cache = TRUE;
static::_status_exit();
@@ -697,7 +697,7 @@ protected function _load_support()
protected function _run_controller()
{
// Call pre_controller hook
- $this->hooks->_call_hook('pre_controller');
+ $this->hooks->call_hook('pre_controller');
// Get the parsed route and identify class, method, and arguments
$rtr_class = get_class($this->router);
@@ -719,7 +719,7 @@ protected function _run_controller()
$this->routed = $this->$class;
// Call post_controller_constructor hook
- $this->hooks->_call_hook('post_controller_constructor');
+ $this->hooks->call_hook('post_controller_constructor');
if ($this->call_controller($class, $method, $args) == FALSE)
{
@@ -758,17 +758,17 @@ protected function _finalize()
// Call post_controller hook unless we're displaying a cache
if ( ! $this->_display_cache)
{
- $this->hooks->_call_hook('post_controller');
+ $this->hooks->call_hook('post_controller');
}
// Send the final rendered output to the browser
- if ($this->hooks->_call_hook('display_override') === FALSE && isset($this->output))
+ if ($this->hooks->call_hook('display_override') === FALSE && isset($this->output))
{
$this->output->_display();
}
// Call post_system hook
- $this->hooks->_call_hook('post_system');
+ $this->hooks->call_hook('post_system');
}
}
@@ -286,7 +286,7 @@ public function test_load_base()
$classes = array(
'Benchmark' => array('methods' => array('mark($a)' => '$this->'.$marks.'[] = $a;')),
'Config' => array('methods' => array('get($a, $b)' => 'return TRUE;')),
- 'Hooks' => array('methods' => array('_call_hook($a)' => '$this->'.$hooks.'[] = $a; return FALSE;')),
+ 'Hooks' => array('methods' => array('call_hook($a)' => '$this->'.$hooks.'[] = $a; return FALSE;')),
'Loader' => array('obj' => 'load')
);
$names = $this->_create_core($pre, $prop, $classes);
@@ -338,7 +338,7 @@ public function test_load_routing()
// The order here establishes the sequence that will be checked below
// We include Hooks first, as it was already loaded and is called in routing
$classes = array(
- 'Hooks' => array('methods' => array('_call_hook($a)' => '$this->'.$hooks.'[] = $a; return FALSE;')),
+ 'Hooks' => array('methods' => array('call_hook($a)' => '$this->'.$hooks.'[] = $a; return FALSE;')),
'Utf8' => array(),
'URI' => array(),
'Output' => array('methods' => array('_display_cache()' => 'return FALSE;')),
@@ -396,7 +396,7 @@ public function test_load_cache()
// Create core classes in VFS
// This time, _display_cache will return TRUE as if it displayed the cache
$classes = array(
- 'Hooks' => array('methods' => array('_call_hook($a)' => 'return FALSE;')),
+ 'Hooks' => array('methods' => array('call_hook($a)' => 'return FALSE;')),
'Utf8' => array(),
'URI' => array(),
'Output' => array('methods' => array('_display_cache()' => 'return TRUE;')),
@@ -706,7 +706,7 @@ private function _create_run_core($pre, $prop, $route, $marks = FALSE, $hooks =
// Create Hooks with optional hook tracking
$code = $hooks ? '$this->'.$hooks.'[] = $a; ' : '';
- $this->_create_core($pre, $prop, 'Hooks', '', array('_call_hook($a)' => $code.'return FALSE;'));
+ $this->_create_core($pre, $prop, 'Hooks', '', array('call_hook($a)' => $code.'return FALSE;'));
// Create Loader with a simple controller loader to instantiate our class
// at the right time

0 comments on commit bbd3b98

Please sign in to comment.