summaryrefslogtreecommitdiffstats
path: root/system/core/CodeIgniter.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-03-09 11:08:36 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-03-09 11:08:36 +0100
commit93ca71552d9a3e28eeaa00dd10755d20b2cbf32e (patch)
tree660233f2ec631e5730731491d2fd244fe15f7df8 /system/core/CodeIgniter.php
parenta9924b8352aa18869677bea0182c45e2a7e2ce37 (diff)
parent2f8b27efeb0a39c24eddf89cf31ea0fd113a6b71 (diff)
Merged recent Core changes and fixed conflict.
Diffstat (limited to 'system/core/CodeIgniter.php')
-rw-r--r--system/core/CodeIgniter.php29
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 */