The loadPluginModels function doesn't check for class existence.  This is a problem for me because I have to preload some models from a plugin before the cake dispatcher tries to load the rest of the models.  I'm using cake 1.1.8.3544.

I attached a patch.

- Christoph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

--- cake/basics.orig.php	2006-10-26 10:58:20.000000000 -0700
+++ cake/basics.php	2006-10-26 11:00:35.000000000 -0700
@@ -99,16 +99,15 @@
 			overload($pluginAppModel);
 		}
 		$pluginModelDir = APP . 'plugins' . DS . $plugin . DS . 'models' . DS;
-		$loadedPluginModels = array();
 		foreach(listClasses($pluginModelDir)as $modelFileName) {
-			if (!key_exists($modelFileName, $loadedPluginModels)) {
+			list($name) = explode('.', $modelFileName);
+			$className = Inflector::camelize($name);
+			if (!class_exists($className)) {
 				require($pluginModelDir . $modelFileName);
 
 				if (phpversion() < 5 && function_exists("overload")) {
-					list($name) = explode('.', $modelFileName);
-					overload(Inflector::camelize($name));
+					overload($className);
 				}
-				$loadedPluginModels[$modelFileName] = $modelFileName;
 			}
 		}
 	}

Reply via email to