summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-12 12:42:09 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-12 12:42:09 +0100
commit12d7b468d907c73abac3e3711b2f53c2fce25199 (patch)
tree4531318bcb36c2316932a4eafaaf5cca4ff02f0e
parentb67277b8063b0e6aab051ce269194255ef83e808 (diff)
Fix issue #777
-rw-r--r--system/core/Loader.php21
-rw-r--r--user_guide_src/source/changelog.rst3
2 files changed, 16 insertions, 8 deletions
diff --git a/system/core/Loader.php b/system/core/Loader.php
index a9eec396c..1e6eafe8a 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -532,27 +532,34 @@ class CI_Loader {
continue;
}
- $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
-
// Is this a helper extension request?
- if (file_exists($ext_helper))
+ $ext_helper = config_item('subclass_prefix').$helper;
+ $ext_loaded = FALSE;
+ foreach ($this->_ci_helper_paths as $path)
{
- $base_helper = BASEPATH.'helpers/'.$helper.'.php';
+ if (file_exists($path.'helpers/'.$ext_helper.'.php'))
+ {
+ include_once($path.'helpers/'.$ext_helper.'.php');
+ $ext_loaded = TRUE;
+ }
+ }
+ // If we have loaded extensions - check if the base one is here
+ if ($ext_loaded === TRUE)
+ {
+ $base_helper = BASEPATH.'helpers/'.$helper.'.php';
if ( ! file_exists($base_helper))
{
show_error('Unable to load the requested file: helpers/'.$helper.'.php');
}
- include_once($ext_helper);
include_once($base_helper);
-
$this->_ci_helpers[$helper] = TRUE;
log_message('debug', 'Helper loaded: '.$helper);
continue;
}
- // Try to load the helper
+ // No extensions found ... try loading regular helpers and/or overrides
foreach ($this->_ci_helper_paths as $path)
{
if (file_exists($path.'helpers/'.$helper.'.php'))
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 792969cf4..1a80f76a3 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -439,7 +439,8 @@ Bug fixes for 3.0
- Fixed a bug - :doc:`Routing Library <general/routing>` didn't properly handle *default_controller* in a subdirectory when a method is also specified.
- Fixed a bug (#953) - :doc:`post_controller_constructor hook <general/hooks>` wasn't called with a *404_override*.
- Fixed a bug (#1220) - :doc:`Profiler Library <general/profiling>` didn't display information for database objects that are instantiated inside models.
-- Fixed a bug (#1978) - :doc:`Directory Helper <helpers/directory_helper>` function ``directory_map()``'s return array didn't make a distinction between directories and file indexes when a directory with a numeric name is present.
+- Fixed a bug (#1978) - :doc:`Directory Helper <helpers/directory_helper>` function :php:func:`directory_map()`'s return array didn't make a distinction between directories and file indexes when a directory with a numeric name is present.
+- Fixed a bug (#777) - :doc:`Loader Library <libraries/loader>` didn't look for helper extensions in added package paths.
Version 2.1.3
=============