summaryrefslogtreecommitdiffstats
path: root/system/codeigniter/CodeIgniter.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/codeigniter/CodeIgniter.php')
-rw-r--r--system/codeigniter/CodeIgniter.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php
index 5b3f54ae3..3e2b99dea 100644
--- a/system/codeigniter/CodeIgniter.php
+++ b/system/codeigniter/CodeIgniter.php
@@ -125,9 +125,16 @@ else
require(BASEPATH.'codeigniter/Base5'.EXT);
}
+// Load the base controller class
load_class('Controller', FALSE);
-require(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT);
+// Load the local application controller
+// Note: The Router class automatically validates the controller path. If this include fails it
+// means that the default controller in the Routes.php file is not resolving to something valid.
+if ( ! @include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT))
+{
+ show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
+}
// Set a mark point for benchmarking
$BM->mark('loading_time_base_classes_end');