selector.php

Go to the documentation of this file.
00001 <?php
00025 // Get config instance
00026 $cfg = FrameworkConfiguration::getInstance();
00027 
00028 // Try to load these includes in the given order
00029 $configAppIncludes = array(
00030         sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class
00031         "config",               // The application's own configuration
00032         "data",                 // Application data
00033         "init",                 // The application initializer
00034         "loader",               // The application's class loader
00035         "debug",                // Some debugging stuff
00036         "exceptions",   // The application's own exception handler
00037         "starter",              // The application starter (calls entryPoint(), etc.)
00038 );
00039 
00040 // Load them all (try only)
00041 foreach ($configAppIncludes as $inc) {
00042         // Skip starter in test mode
00043         if (($inc == "starter") && (defined('TEST'))) {
00044                 // Skip it here
00045                 continue;
00046         }
00047 
00048         // Generate a FQFN for the helper class
00049         $fqfn = sprintf("%s%s/%s.php",
00050                 $cfg->readConfig('application_path'),
00051                 $cfg->readConfig('app_name'),
00052                 $inc
00053         );
00054 
00055         // Does the include file exists?
00056         if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
00057                 // Load it
00058                 require_once($fqfn);
00059         } elseif ($cfg->readConfig('verbose_level') > 0) {
00060                 // File is missing
00061                 trigger_error(sprintf("Cannot load application script %s.php! File is missing or read-protected.",
00062                         $inc
00063                 ));
00064         }
00065 }
00066 
00067 // [EOF]
00068 ?>

Generated on Mon Dec 8 01:06:46 2008 for Ship-Simulator by  doxygen 1.5.6