Tip: Disable CakePHP model auto-load and trace the load paths
Here is how to disable the model auto-loading in CakePHP:
// .. around line 140 in /cake/libs/class_registry.php
} elseif ($type === 'Model') {
if ($plugin && class_exists($plugin . 'AppModel')) {
$appModel = $plugin . 'AppModel';
} else {
$appModel = 'AppModel';
}
$settings['name'] = $class;
$ai =& App::getInstance();
$search = $ai->__paths('Model');
$pathstr = '';
$file = Inflector::underscore($class.'.php');
foreach ($search as $path) {
$path = rtrim($path, DS);
if ($path === rtrim(APP, DS)) {
$recursive = false;
}
if (true === false) {
$pathstr .= $path . DS . $file.'|';
continue;
}
if (!isset($this->__paths[$path])) {
if (!class_exists('Folder')) {
require LIBS . 'folder.php';
}
$Folder =& new Folder();
$directories = $Folder->tree($path, false, 'dir');
$this->__paths[$path] = $directories;
}
foreach ($this->__paths[$path] as $directory) {
$pathstr .= $path . DS . $file.'|';
}
}
die("unable to find class $type, $plugin$class "
."(search path: ".$pathstr.")");
${$class} =& new $appModel($settings);
}