diff options
author | admin <devnull@localhost> | 2006-10-01 21:02:29 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-01 21:02:29 +0200 |
commit | 24dd7e71d2587c4290c85bc85e0e181b29ab0539 (patch) | |
tree | 7455c1464ee2d1f4808261643dc8a727be3f8957 /system/libraries/Controller.php | |
parent | a59c2a1ad6d12ae38dc36ff7f163468463961b4d (diff) |
Diffstat (limited to 'system/libraries/Controller.php')
-rw-r--r-- | system/libraries/Controller.php | 21 |
1 files changed, 12 insertions, 9 deletions
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; } } |