X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Floader.php;h=e18c7490cc06ad8f4c5092b9e1ccda0996162b34;hb=b32540971288c1c95139d65e75c72c1e456c9337;hp=240c01aec9344f478869b108de57018de6281ec1;hpb=65d72098d3ec6a0ef7782668264fc6f33f9ebeb6;p=shipsimu.git diff --git a/application/ship-simu/loader.php b/application/ship-simu/loader.php index 240c01a..e18c749 100644 --- a/application/ship-simu/loader.php +++ b/application/ship-simu/loader.php @@ -6,7 +6,7 @@ * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @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,46 +22,14 @@ * 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] 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() - )); - } -} - -// Include all classes -ClassLoader::getInstance()->includeAllClasses(); + // Load the application classes + ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/%s", $cfg->readConfig('application_path'), $cfg->readConfig('app_name'), $class)); +} // END - if // Clean up the global namespace unset($lowerClasses);