summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-08-29 18:58:26 +0200
committerdchill42 <dchill42@gmail.com>2012-08-29 18:58:26 +0200
commit60d100f0fde3fba4fa4015f44f490b7ecac16138 (patch)
tree4568707c49c4ede4c195fca0db798918f2baa073 /system
parent9a949fab0c8428233f0de5b199bf955e61fb0e0a (diff)
Added autoloader unit test with minor supporting change in Loader
Signed-off-by: dchill42 <dchill42@gmail.com>
Diffstat (limited to 'system')
-rw-r--r--system/core/Loader.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 0d05649ca..638c7932c 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -75,6 +75,14 @@ class CI_Loader {
protected $_ci_helper_paths = array();
/**
+ * Path to autoloader config file
+ * This lets us override it in unit testing
+ *
+ * @var string
+ */
+ protected $_ci_autoloader_path = APPPATH;
+
+ /**
* List of loaded base classes
*
* @var array
@@ -1140,13 +1148,13 @@ class CI_Loader {
*/
protected function _ci_autoloader()
{
- if (defined('ENVIRONMENT') && file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'))
+ if (defined('ENVIRONMENT') && file_exists($this->_ci_autoloader_path.'config/'.ENVIRONMENT.'/autoload.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php');
+ include($this->_ci_autoloader_path.'config/'.ENVIRONMENT.'/autoload.php');
}
else
{
- include(APPPATH.'config/autoload.php');
+ include($this->_ci_autoloader_path.'config/autoload.php');
}
if ( ! isset($autoload))