diff options
-rw-r--r-- | system/core/Loader.php | 18 | ||||
-rw-r--r-- | tests/mocks/core/loader.php | 1 |
2 files changed, 6 insertions, 13 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php index 638c7932c..242b19069 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -75,14 +75,6 @@ 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 @@ -1148,13 +1140,16 @@ class CI_Loader { */ protected function _ci_autoloader() { - if (defined('ENVIRONMENT') && file_exists($this->_ci_autoloader_path.'config/'.ENVIRONMENT.'/autoload.php')) + // Get autoloader file from config path + $CI =& get_instance(); + $path = reset($CI->config->_config_paths).'config/'; + if (defined('ENVIRONMENT') && file_exists($path.ENVIRONMENT.'/autoload.php')) { - include($this->_ci_autoloader_path.'config/'.ENVIRONMENT.'/autoload.php'); + include($path.ENVIRONMENT.'/autoload.php'); } else { - include($this->_ci_autoloader_path.'config/autoload.php'); + include($path.'autoload.php'); } if ( ! isset($autoload)) @@ -1174,7 +1169,6 @@ class CI_Loader { // Load any custom config file if (count($autoload['config']) > 0) { - $CI =& get_instance(); foreach ($autoload['config'] as $key => $val) { $CI->config->load($val); diff --git a/tests/mocks/core/loader.php b/tests/mocks/core/loader.php index c0e02139e..9eb78253b 100644 --- a/tests/mocks/core/loader.php +++ b/tests/mocks/core/loader.php @@ -30,7 +30,6 @@ class Mock_Core_Loader extends CI_Loader { $this->_ci_helper_paths = array($this->app_path, $this->base_path); $this->_ci_model_paths = array($this->app_path); $this->_ci_view_paths = array($this->app_path.'views/' => TRUE); - $this->_ci_autoloader_path = $this->app_path; } /** |