From 401fb497c15cb4d8534d0bd314bb90d254f78de6 Mon Sep 17 00:00:00 2001 From: William Knauss Date: Tue, 27 Nov 2012 00:01:03 -0500 Subject: 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. --- system/libraries/Driver.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'system/libraries') 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 -- cgit v1.2.3-24-g4f1b From 0ab4d3a71e0c65b717e1b3a95fa01e8cc37574b3 Mon Sep 17 00:00:00 2001 From: William Knauss Date: Wed, 28 Nov 2012 10:05:53 -0500 Subject: Remove Comment As requested removed useless comment --- system/libraries/Driver.php | 1 - 1 file changed, 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index 246f47f40..8323e8f01 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -160,7 +160,6 @@ class CI_Driver_Library { // Did we finally find the class? if ( ! class_exists($class_name)) { - // last ditch effort. Maybe someone is coding by the 2.1 driver style. if (class_exists($child_name)) { $class_name = $child_name; -- cgit v1.2.3-24-g4f1b