From 24dd7e71d2587c4290c85bc85e0e181b29ab0539 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 1 Oct 2006 19:02:29 +0000 Subject: --- system/libraries/Controller.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'system/libraries/Controller.php') diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 51f455023..c02074fca 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -80,6 +80,13 @@ class Controller extends CI_Base { { // Prep the class name $class = strtolower(str_replace(EXT, '', $class)); + + // Bug fix for backward compat. + // Kill this at some point in the future + if ($class == 'unit_test') + { + $class = 'unit'; + } // Is this a class extension request? if (substr($class, 0, 3) == 'my_') @@ -168,9 +175,8 @@ class Controller extends CI_Base { * @return null */ function _ci_init_class($class, $prefix = '', $config = NULL) - { + { // Is there an associated config file for this class? - if ($config == NULL) { if (file_exists(APPPATH.'config/'.$class.EXT)) @@ -185,22 +191,19 @@ class Controller extends CI_Base { } else { - $name = $prefix.ucfirst($class); + $name = $prefix.$class; } - - $remap = array( - 'Unit_test' => 'unit' - ); $varname = ( ! isset($remap[$class])) ? $class : $remap[$class]; - + $varname = strtolower($varname); + // Instantiate the class if ($config !== NULL) { $this->$varname = new $name($config); } else - { + { $this->$varname = new $name; } } -- cgit v1.2.3-24-g4f1b