From d5e0cb5fe94fb7a89cc12842511481a3c3d37d8e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 9 Mar 2010 20:20:46 -0600 Subject: sped up Driver loading slightly by predicting subfolder location --- system/core/Loader.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/core/Loader.php b/system/core/Loader.php index c399f296d..1726f0a53 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -558,7 +558,14 @@ class CI_Loader { if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself - require_once BASEPATH.'libraries/Driver'.EXT; + require BASEPATH.'libraries/Driver'.EXT; + } + + // 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, '/')) + { + $library = $library.'/'.$library; } return $this->library($library, $params, $object_name); -- cgit v1.2.3-24-g4f1b