From 6262d053db57957c4445ef7fce76070854c3e30d Mon Sep 17 00:00:00 2001 From: dchill42 Date: Sat, 24 Nov 2012 18:41:13 -0500 Subject: Added support for extending individual driver classes and driver unit tests Signed-off-by: dchill42 --- system/core/Loader.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'system/core/Loader.php') diff --git a/system/core/Loader.php b/system/core/Loader.php index 1e6eafe8a..651507470 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -669,6 +669,12 @@ class CI_Loader { return FALSE; } + if ( ! class_exists('CI_Driver_Library')) + { + // We aren't instantiating an object here, just making the base class available + require BASEPATH.'libraries/Driver.php'; + } + // We can save the loader some time since Drivers will *always* be in a subfolder, // and typically identically named to the library if ( ! strpos($library, '/')) @@ -949,13 +955,6 @@ class CI_Loader { // Get the filename from the path $class = substr($class, $last_slash); - - // Check for match and driver base class - if (strtolower(trim($subdir, '/')) == strtolower($class) && ! class_exists('CI_Driver_Library')) - { - // We aren't instantiating an object here, just making the base class available - require BASEPATH.'libraries/Driver.php'; - } } // We'll test for both lowercase and capitalized versions of the file name -- cgit v1.2.3-24-g4f1b