summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-01-28 20:19:13 +0100
committerAndrey Andreev <narf@bofh.bg>2013-01-28 20:19:13 +0100
commit662e34291a2d5d8997ea9835701fb9a8a7ec244c (patch)
treeac38eaa1216e9b8091a8535d88a9d7a967f55815 /system/libraries
parent55bbd7207d5276a7546e60f28c4c31325bab2b5e (diff)
Some micro-optimization to the Driver library loader
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Driver.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 4b35dce73..382420db0 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -80,8 +80,7 @@ class CI_Driver_Library {
public function load_driver($child)
{
// Get CodeIgniter instance and subclass prefix
- $CI = get_instance();
- $prefix = (string) $CI->config->item('subclass_prefix');
+ $prefix = config_item('subclass_prefix');
if ( ! isset($this->lib_name))
{
@@ -102,11 +101,12 @@ class CI_Driver_Library {
}
// Get package paths and filename case variations to search
+ $CI = get_instance();
$paths = $CI->load->get_package_paths(TRUE);
// Is there an extension?
$class_name = $prefix.$child_name;
- $found = class_exists($class_name);
+ $found = class_exists($class_name, FALSE);
if ( ! $found)
{
// Check for subclass file
@@ -126,8 +126,8 @@ class CI_Driver_Library {
}
// Include both sources and mark found
- include($basepath);
- include($file);
+ include_once($basepath);
+ include_once($file);
$found = TRUE;
break;
}
@@ -139,8 +139,7 @@ class CI_Driver_Library {
{
// Use standard class name
$class_name = 'CI_'.$child_name;
- $found = class_exists($class_name);
- if ( ! $found)
+ if ( ! class_exists($class_name, FALSE))
{
// Check package paths
foreach ($paths as $path)
@@ -150,7 +149,7 @@ class CI_Driver_Library {
if (file_exists($file))
{
// Include source
- include($file);
+ include_once($file);
break;
}
}
@@ -158,9 +157,9 @@ class CI_Driver_Library {
}
// Did we finally find the class?
- if ( ! class_exists($class_name))
+ if ( ! class_exists($class_name, FALSE))
{
- if (class_exists($child_name))
+ if (class_exists($child_name, FALSE))
{
$class_name = $child_name;
}