diff options
author | Andrey Andreev <narf@devilix.net> | 2014-12-09 16:38:56 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-12-09 16:38:56 +0100 |
commit | cd94dd7e1d8969658810ccc4158a75d2936d0a44 (patch) | |
tree | a1b0975039010a4848fb92e5589721585835a32f /system/libraries/Session | |
parent | 562e39bab43181fb709aeaf4dee14bf481a2cc6a (diff) |
#3073 (feature/session): Allow custom drivers without the CI_ or MY_ prefix
Diffstat (limited to 'system/libraries/Session')
-rw-r--r-- | system/libraries/Session/Session.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 1d93cb1c8..4fa9fd248 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -194,6 +194,17 @@ class CI_Session { } $class = 'Session_'.$driver.'_driver'; + + // Allow custom drivers without the CI_ or MY_ prefix + if ( ! class_exists($class, FALSE) && file_exists($file_path = APPPATH.'libraries/Session/drivers/'.$class.'.php')) + { + require_once($file_path); + if (class_exists($class, FALSE)) + { + return $class; + } + } + if ( ! class_exists('CI_'.$class, FALSE)) { if (file_exists($file_path = APPPATH.'libraries/Session/drivers/'.$class.'.php') OR file_exists($file_path = BASEPATH.'libraries/Session/drivers/'.$class.'.php')) @@ -201,7 +212,7 @@ class CI_Session { require_once($file_path); } - if ( ! class_exists('CI_'.$class, FALSE)) + if ( ! class_exists('CI_'.$class, FALSE) && ! class_exists($class, FALSE)) { log_message('error', "Session: Configured driver '".$driver."' was not found. Aborting."); return FALSE; |