More renamed
[shipsimu.git] / application / ship-simu / loader.php
index e6cf6503ff7d55137590ecfaad4087409a8779c6..d28600b837e069b16a7f0694c3e898acb8d43bc5 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A specialized class loader for this class
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  */
 
 // Get config instance
-$cfg = FrameworkConfiguration::getInstance();
+$cfg = FrameworkConfiguration::getSelfInstance();
 
 // Load all classes for the application
-foreach ($lowerClasses as $class) {
-       // Try to load the application classes
-       try {
-               ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/%s", $cfg->readConfig('application_path'), $cfg->readConfig('app_name'), $class));
-       } catch (PathIsNoDirectoryException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path <u>%s</u> for this reason: <u>%s</u>",
-                       $application,
-                       $class,
-                       $e->getMessage()
-               ));
-       } catch (PathIsEmptyException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path <u>%s</u> for this reason: <u>%s</u>",
-                       $application,
-                       $class,
-                       $e->getMessage()
-               ));
-       } catch (PathReadProtectedException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path <u>%s</u> for this reason: <u>%s</u>",
-                       $application,
-                       $class,
-                       $e->getMessage()
-               ));
-       } catch (DirPointerNotOpenedException $e) {
-               ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path <u>%s</u> for this reason: <u>%s</u>",
-                       $application,
-                       $class,
-                       $e->getMessage()
-               ));
-       }
-}
+foreach ($lowerClasses as $className) {
+       // Load the application classes
+       ClassLoader::getSelfInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $className));
+} // END - if
 
 // Clean up the global namespace
 unset($lowerClasses);
-unset($class);
+unset($className);
 
 // [EOF]
 ?>