Permalink
Browse files

Simplified class init name detection

Signed-off-by: dchill42 <dchill42@gmail.com>
  • Loading branch information...
1 parent bd8eb80 commit 14bcaeda65c18e916b9c9a6c7a8b55c0442f2c18 @dchill42 committed Nov 25, 2012
Showing with 1 addition and 19 deletions.
  1. +1 −19 system/core/Loader.php
View
@@ -1030,25 +1030,7 @@ protected function _ci_load_class($class, $params = NULL, $object_name = NULL)
protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL)
{
// Determine class name
- if ($prefix === '')
- {
- if (class_exists('CI_'.$class))
- {
- $name = 'CI_'.$class;
- }
- elseif (class_exists(config_item('subclass_prefix').$class))
- {
- $name = config_item('subclass_prefix').$class;
- }
- else
- {
- $name = $class;
- }
- }
- else
- {
- $name = $prefix.$class;
- }
+ $name = ($prefix === '' && class_exists('CI_'.$class)) ? 'CI_'.$class : $prefix.$class;
// Is the class name valid?
if ( ! class_exists($name))

0 comments on commit 14bcaed

Please sign in to comment.