X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=application%2Fship-simu%2Floader.php;h=d28600b837e069b16a7f0694c3e898acb8d43bc5;hp=d60af4c88814987d00756f599962fa3021f8ef0e;hb=4f70843ae8428f051d70ccff5bb43fc4c03dda8d;hpb=fd80d47afc96ae0c0759530800051a0f07eb9c92 diff --git a/application/ship-simu/loader.php b/application/ship-simu/loader.php index d60af4c..d28600b 100644 --- a/application/ship-simu/loader.php +++ b/application/ship-simu/loader.php @@ -2,11 +2,11 @@ /** * A specialized class loader for this class * - * @author Roland Haeder + * @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.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 @@ -23,43 +23,17 @@ */ // 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 %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::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] ?>