mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing overload() calls in both branches
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3828 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
d77a19e4a4
commit
4cfafba726
1 changed files with 5 additions and 3 deletions
|
@ -57,9 +57,8 @@
|
|||
} else {
|
||||
require(CAKE . 'app_model.php');
|
||||
}
|
||||
Overloadable::overload('AppModel');
|
||||
}
|
||||
|
||||
Overloadable::overload('AppModel');
|
||||
$loadedModels = array();
|
||||
|
||||
foreach($path->modelPaths as $path) {
|
||||
|
@ -67,6 +66,7 @@
|
|||
if (!key_exists($model_fn, $loadedModels)) {
|
||||
require($path . $model_fn);
|
||||
list($name) = explode('.', $model_fn);
|
||||
Overloadable::overload(Inflector::camelize($name));
|
||||
$loadedModels[$model_fn] = $model_fn;
|
||||
}
|
||||
}
|
||||
|
@ -87,9 +87,9 @@
|
|||
} else {
|
||||
die('Plugins must have a class named ' . $pluginAppModel);
|
||||
}
|
||||
Overloadable::overload($pluginAppModel);
|
||||
}
|
||||
|
||||
Overloadable::overload($pluginAppModel);
|
||||
$pluginModelDir = APP . 'plugins' . DS . $plugin . DS . 'models' . DS;
|
||||
|
||||
foreach(listClasses($pluginModelDir)as $modelFileName) {
|
||||
|
@ -98,6 +98,7 @@
|
|||
|
||||
if (!class_exists($className)) {
|
||||
require($pluginModelDir . $modelFileName);
|
||||
Overloadable::overload($className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,6 +148,7 @@
|
|||
foreach($paths->modelPaths as $path) {
|
||||
if (file_exists($path . $name . '.php')) {
|
||||
require($path . $name . '.php');
|
||||
Overloadable::overload($className);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue