$fileName = $this->prefix . $className . $this->suffix;
// Now look it up in our index
- if (isset($this->classes[$fileName])) {
- // File is found so load it only once
+ if ((isset($this->classes[$fileName])) && (!in_array($this->classes[$fileName], $this->loadedClasses))) {
+ // File is found and not loaded so load it only once
//* DEBUG: */ echo "LOAD: ".$fileName." - Start<br />\n";
require($this->classes[$fileName]);
//* DEBUG: */ echo "LOAD: ".$fileName." - End<br />\n";
// Mark this class as loaded
$this->loadedClasses[] = $this->classes[$fileName];
+ // Remove it from classes list
+ unset($this->classes[$fileName]);
+
// Developer mode excludes caching (better debugging)
if (!defined('DEVELOPER')) {
// Reset cache