X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Floader.php;h=46790372d73b380be89a123e1d470c2b4b99fb56;hb=7150507e7bf41150778d5d0bdaaf7f6f41739ddf;hp=0dffa20e3fa5292556228d2ed9e1e380f0bac844;hpb=b912eda46059527fc0475e043944c3ebff47fbcd;p=shipsimu.git diff --git a/application/ship-simu/loader.php b/application/ship-simu/loader.php index 0dffa20..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 @@ -22,50 +22,18 @@ * along with this program. If not, see . */ -// Is the application instance set? -if (!isset($application)) { - // We need this! - ApplicationEntryPoint::app_die("[Main:] Interne Variable application nicht gefunden!"); -} +// Get config instance +$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", FrameworkConfiguration::getInstance()->readConfig("application_path"), $application, $class)); - } catch (PathIsNoDirectoryException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", - $application, - $class, - $e->getMessage() - )); - } catch (PathIsEmptyException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", - $application, - $class, - $e->getMessage() - )); - } catch (PathReadProtectedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", - $application, - $class, - $e->getMessage() - )); - } catch (DirPointerNotOpenedException $e) { - ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad %s nicht laden. Grund: %s", - $application, - $class, - $e->getMessage() - )); - } -} - -// Include all classes -ClassLoader::getInstance()->includeAllClasses(); +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] ?>