mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-12 06:56:24 +00:00
Enabling auto-load for AppHelper
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3751 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
de52eb88c9
commit
607dfac428
1 changed files with 8 additions and 1 deletions
|
@ -264,13 +264,20 @@
|
||||||
*/
|
*/
|
||||||
function loadHelper($name) {
|
function loadHelper($name) {
|
||||||
$paths = Configure::getInstance();
|
$paths = Configure::getInstance();
|
||||||
|
if (!class_exists('AppHelper')) {
|
||||||
|
if (file_exists(APP . 'app_helper.php')) {
|
||||||
|
require(APP . 'app_helper.php');
|
||||||
|
} else {
|
||||||
|
require(CAKE . 'app_helper.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists($name . 'Helper')) {
|
if (!class_exists($name . 'Helper')) {
|
||||||
$name=Inflector::underscore($name);
|
$name = Inflector::underscore($name);
|
||||||
|
|
||||||
foreach($paths->helperPaths as $path) {
|
foreach($paths->helperPaths as $path) {
|
||||||
if (file_exists($path . $name . '.php')) {
|
if (file_exists($path . $name . '.php')) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue