*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
$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