Skip to content

Commit

Permalink
Children Drivers
Browse files Browse the repository at this point in the history
This allows developers to create children drivers that are not prefix
with "CI_". This is a nity grity change, however it keeps with the
mindset that class names that start with CI_ are typically overrides of
core classes.
  • Loading branch information
William Knauss committed Nov 27, 2012
1 parent 719b60f commit 401fb49
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions system/libraries/Driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -160,9 +160,17 @@ public function load_driver($child)
// Did we finally find the class? // Did we finally find the class?
if ( ! class_exists($class_name)) if ( ! class_exists($class_name))
{ {
$msg = 'Unable to load the requested driver: '.$class_name; // last ditch effort. Maybe someone is coding by the 2.1 driver style.
log_message('error', $msg); if (class_exists($child_name))
show_error($msg); {
$class_name = $child_name;
}
else
{
$msg = 'Unable to load the requested driver: '.$class_name;
log_message('error', $msg);
show_error($msg);
}
} }


// Instantiate, decorate and add child // Instantiate, decorate and add child
Expand Down

0 comments on commit 401fb49

Please sign in to comment.