summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorWilliam Knauss <will.knauss@gmail.com>2012-11-27 06:01:03 +0100
committerWilliam Knauss <will.knauss@gmail.com>2012-11-27 06:01:03 +0100
commit401fb497c15cb4d8534d0bd314bb90d254f78de6 (patch)
treef1bb70d6cead42196d29b42110e71713a8984fa7 /system/libraries
parent719b60f7e84e7060b679a9359a487f5cbbb937bf (diff)
Children Drivers
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.
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Driver.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 72f376466..246f47f40 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -160,9 +160,17 @@ class CI_Driver_Library {
// Did we finally find the class?
if ( ! class_exists($class_name))
{
- $msg = 'Unable to load the requested driver: '.$class_name;
- log_message('error', $msg);
- show_error($msg);
+ // last ditch effort. Maybe someone is coding by the 2.1 driver style.
+ if (class_exists($child_name))
+ {
+ $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