/**
* Instance of this class
*/
- private static $thisInstance = null;
+ private static $selfInstance = null;
/**
* The *public* constructor
$this->classes = new ArrayObject();
// Set own instance
- self::$thisInstance = $this;
+ self::$selfInstance = $this;
}
/**
* Getter for an instance of this class
*
- * @return $thisInstance An instance of this class
+ * @return $selfInstance An instance of this class
*/
public final static function getInstance () {
- return self::$thisInstance;
+ // Is the instance there?
+ if (is_null(self::$selfInstance)) {
+ // Get a new one
+ self::$selfInstance = new ClassLoader(FrameworkConfiguration::getInstance());
+ } // END - if
+
+ // Return the instance
+ return self::$selfInstance;
}
/**
// Scan the directory
$this->scanLocalPath($currPath);
- }
+ } // END - for
// Check if we can leave
$cnt = 0;
for ($idx = $this->dirList->getIterator(); $idx->valid(); $idx->next()) {
if ($idx->current() == "") $cnt++;
- }
- }
+ } // END - for
+ } // END - while
}
/**
} elseif (is_dir($dirClass) && !in_array($dirClass2, $this->ignoreList)) {
// Directory found and added to list
//* DEBUG: */ print "DIR={$dirClass}\n";
- if ($dirClass2 == "interfaces") {
- $this->scanLocalPath($dirClass);
- } else {
- $this->dirList->append($dirClass);
- }
+ $this->dirList->append($dirClass);
$this->dirCnt++;
}
//* DEBUG: */ print "LOOP!\n";
// Close directory handler
$dirInstance->closeDirectory();
+ unset($dirInstance);
// Output counter in debug mode
if (defined('DEBUG_MODE')) print(sprintf("[%s:] <strong>%d</strong> Klassendateien in <strong>%d</strong> Verzeichnissen gefunden und geladen.<br />\n",
// Load current class
//* DEBUG: */ print "Class=".$idx->current()."\n";
require_once($idx->current());
- }
+ } // END - for
// Re-initialize the classes list
$this->classes = new ArrayObject();
- }
+ } // END - if
}
/**
require_once(sprintf("%sinc/classes/main/class_BaseFrameworkSystem%s", PATH, FrameworkConfiguration::getInstance()->readConfig('php_extension')));
require_once(sprintf("%sinc/classes/main/io/class_FrameworkDirectoryPointer%s", PATH, FrameworkConfiguration::getInstance()->readConfig('php_extension')));
-// Initialize the class loader
-$loader = new ClassLoader(FrameworkConfiguration::getInstance());
-
// [EOF]
?>