X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Floader.php;h=46790372d73b380be89a123e1d470c2b4b99fb56;hb=cd42a6c562eb7e5b874b75759634b62f26a76ce3;hp=d60af4c88814987d00756f599962fa3021f8ef0e;hpb=fd80d47afc96ae0c0759530800051a0f07eb9c92;p=shipsimu.git diff --git a/application/ship-simu/loader.php b/application/ship-simu/loader.php index d60af4c..4679037 100644 --- a/application/ship-simu/loader.php +++ b/application/ship-simu/loader.php @@ -4,9 +4,9 @@ * * @author Roland Haeder * @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.ship-simu.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 @@ -26,40 +26,14 @@ $cfg = FrameworkConfiguration::getInstance(); // 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 %s for this reason: %s", - $application, - $class, - $e->getMessage() - )); - } catch (PathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path %s for this reason: %s", - $application, - $class, - $e->getMessage() - )); - } catch (PathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path %s for this reason: %s", - $application, - $class, - $e->getMessage() - )); - } catch (DirPointerNotOpenedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Cannot find application classes in path %s for this reason: %s", - $application, - $class, - $e->getMessage() - )); - } -} +foreach ($lowerClasses as $className) { + // Load the application classes + ClassLoader::getInstance()->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] ?>