X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fselector.php;h=a95bd566fc6af67420cebc90a9748b4c59b451f6;hb=114ddb6dfaf2be44a8d61ebd609cc05302ac702e;hp=40789c0c97a58cdf1437864218a24042a359c472;hpb=361e6320e50a8bb1a3ccb675388b8042361669ae;p=core.git diff --git a/inc/selector.php b/inc/selector.php index 40789c0c..a95bd566 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -22,41 +22,34 @@ * along with this program. If not, see . */ -// Get config instance -$cfg = FrameworkConfiguration::getInstance(); - // Try to load these includes in the given order $configAppIncludes = array( - sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class - "config", // The application's own configuration - "data", // Application data - "init", // The application initializer - "loader", // The application's class loader - "debug", // Some debugging stuff - "exceptions", // The application's own exception handler - "starter", // The application starter (calls entryPoint(), etc.) + 'class_' . FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), // The ApplicationHelper class + 'config', // The application's own configuration + 'data', // Application data + 'init', // The application initializer + 'loader', // The application's class loader + 'debug', // Some debugging stuff + 'exceptions', // The application's own exception handler + 'starter', // The application starter (calls entryPoint(), etc.) ); // Load them all (try only) foreach ($configAppIncludes as $inc) { // Skip starter in test mode - if (($inc == "starter") && (defined('TEST'))) { + if (($inc == 'starter') && (defined('TEST'))) { // Skip it here continue; } // Generate a FQFN for the helper class - $fqfn = sprintf("%s%s/%s.php", - $cfg->readConfig('application_path'), - $cfg->readConfig('app_name'), - $inc - ); + $fqfn = FrameworkConfiguration::getInstance()->readConfig('application_path') . FrameworkConfiguration::getInstance()->readConfig('app_name') . '/' . $inc . '.php'; // Does the include file exists? if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) { // Load it require_once($fqfn); - } elseif ($cfg->readConfig('verbose_level') > 0) { + } elseif (FrameworkConfiguration::getInstance()->readConfig('verbose_level') > 0) { // File is missing trigger_error(sprintf("Cannot load application script %s.php! File is missing or read-protected.", $inc @@ -64,5 +57,8 @@ foreach ($configAppIncludes as $inc) { } } +// Remove variables from namespace, which we don't need +unset($inc, $configAppIncludes, $fqfn); + // [EOF] ?>