mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing return value of loadModels()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4314 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
51d384932f
commit
181a22d659
1 changed files with 3 additions and 2 deletions
|
@ -62,17 +62,18 @@
|
|||
}
|
||||
Overloadable::overload('AppModel');
|
||||
}
|
||||
$loadedModels = array();
|
||||
|
||||
foreach($path->modelPaths as $path) {
|
||||
foreach(listClasses($path)as $model_fn) {
|
||||
foreach(listClasses($path) as $model_fn) {
|
||||
list($name) = explode('.', $model_fn);
|
||||
$className = Inflector::camelize($name);
|
||||
$loadedModels[$model_fn] = $model_fn;
|
||||
|
||||
if (!class_exists($className)) {
|
||||
require($path . $model_fn);
|
||||
list($name) = explode('.', $model_fn);
|
||||
Overloadable::overload(Inflector::camelize($name));
|
||||
$loadedModels[$model_fn] = $model_fn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue