diff options
Diffstat (limited to 'system/core/CodeIgniter.php')
-rw-r--r-- | system/core/CodeIgniter.php | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0d0fffbe1..6ac333a52 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -39,7 +39,7 @@ * Define the CodeIgniter Branch (Core = TRUE, Reactor = FALSE) * ------------------------------------------------------ */ - define('CI_CORE', TRUE); + define('CI_CORE', FALSE); /* * ------------------------------------------------------ @@ -87,7 +87,7 @@ { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } - + /* * ------------------------------------------------------ * Set a liberal script execution time limit @@ -296,7 +296,28 @@ // methods, so we'll use this workaround for consistent behavior if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) { - show_404("{$class}/{$method}"); + // Check and see if we are using a 404 override and use it. + if ( ! empty($RTR->routes['404_override'])) + { + $x = explode('/', $RTR->routes['404_override']); + $class = $x[0]; + $method = (isset($x[1]) ? $x[1] : 'index'); + if ( ! class_exists($class)) + { + if ( ! file_exists(APPPATH.'controllers/'.$class.EXT)) + { + show_404("{$class}/{$method}"); + } + + include_once(APPPATH.'controllers/'.$class.EXT); + unset($CI); + $CI = new $class(); + } + } + else + { + show_404("{$class}/{$method}"); + } } // Call the requested method. @@ -344,4 +365,4 @@ /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */
\ No newline at end of file +/* Location: ./system/core/CodeIgniter.php */ |