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:
phpnut 2006-11-05 06:56:28 +00:00
parent d77a19e4a4
commit 4cfafba726

View file

@ -57,9 +57,8 @@
} else {
require(CAKE . 'app_model.php');
}
}
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;
}
}