]> git.mxchange.org Git - core.git/blobdiff - inc/selector.php
Double->single converted, framework will abort if application is not found
[core.git] / inc / selector.php
index 69dfe73d0ee2f85329e7a6734a7d398cacaf9e8d..05b2379deb14d45e65ae84af7a455ca0033722cb 100644 (file)
@@ -34,6 +34,15 @@ $configAppIncludes = array(
        'starter',              // The application starter (calls entryPoint(), etc.)
 );
 
+// Cache base path/file here
+$basePathFile = FrameworkConfiguration::getInstance()->readConfig('application_path') . FrameworkConfiguration::getInstance()->readConfig('app_name');
+
+// Is the directory there?
+if (!is_dir($basePathFile)) {
+       // Not found.
+       trigger_error('Application ' . FrameworkConfiguration::getInstance()->readConfig('app_name') . ' not found.');
+} // END - if
+
 // Load them all (try only)
 foreach ($configAppIncludes as $appInc) {
        // Skip starter in test mode
@@ -43,7 +52,7 @@ foreach ($configAppIncludes as $appInc) {
        }
 
        // Generate a FQFN for the helper class
-       $appFqFn = FrameworkConfiguration::getInstance()->readConfig('application_path') . FrameworkConfiguration::getInstance()->readConfig('app_name') . '/' . $appInc . '.php';
+       $appFqFn = $basePathFile . '/' . $appInc . '.php';
 
        // Does the include file exists?
        if ((file_exists($appFqFn)) && (is_file($appFqFn)) && (is_readable($appFqFn))) {
@@ -60,7 +69,7 @@ foreach ($configAppIncludes as $appInc) {
 }
 
 // Remove variables from namespace, which we don't need
-unset($appInc, $configAppIncludes, $appFqFn);
+unset($appInc, $configAppIncludes, $appFqFn, $basePathFile);
 
 // [EOF]
 ?>