* 1.3
* - Constructor is now empty and factory method 'createClassLoader' is created
* - renamed loadClasses to scanClassPath
+ * - Added initLoader(), $cfgInstance renamed to $configInstance
* 1.2
* - ClassLoader rewritten to PHP SPL's own RecursiveIteratorIterator class
* 1.1
/**
* Our renamed factory method
*
- * @param $cfgInstance Configuration class instance
+ * @param $configInstance Configuration class instance
* @return void
*/
- public final static function createClassLoader (FrameworkConfiguration $cfgInstance) {
+ public final static function createClassLoader (FrameworkConfiguration $configInstance) {
+ // Get a new instance
+ $loaderInstance = new ClassLoader();
+
+ // Init the instance
+ $loaderInstance->initLoader($configInstance);
+
+ // Return the prepared instance
+ return $loaderInstance;
+ }
+
+ /**
+ * Initializes our loader class
+ *
+ * @param $configInstance Configuration class instance
+ * @return void
+ */
+ protected function initLoader (FrameworkConfiguration $configInstance) {
// Set configuration instance
- $this->cfgInstance = $cfgInstance;
+ $this->cfgInstance = $configInstance;
// Construct the FQFN for the cache
if (!defined('DEVELOPER')) {
} // END - if
// Set suffix and prefix from configuration
- $this->suffix = $cfgInstance->readConfig('class_suffix');
- $this->prefix = $cfgInstance->readConfig('class_prefix');
+ $this->suffix = $configInstance->readConfig('class_suffix');
+ $this->prefix = $configInstance->readConfig('class_prefix');
// Set own instance
self::$selfInstance = $this;