]> git.mxchange.org Git - core.git/blobdiff - framework/bootstrap/class_FrameworkBootstrap.php
Continued:
[core.git] / framework / bootstrap / class_FrameworkBootstrap.php
index 9f376df51ba254807866e0160364ccd306620950..5d9aa02757ef55375523b11c3d96fae8d16c9ff9 100644 (file)
@@ -84,7 +84,7 @@ final class FrameworkBootstrap {
         * Includes applications may have. They will be tried in the given order,
         * some will become soon deprecated.
         */
-       private static $configAppIncludes = array(
+       private static $configAppIncludes = [
                // The ApplicationHelper class (required)
                'class_ApplicationHelper' => 'required',
                // Some debugging stuff (optional but can be committed)
@@ -103,7 +103,7 @@ final class FrameworkBootstrap {
                'init'                    => 'deprecated',
                // Application starter (deprecated)
                'starter'                 => 'deprecated',
-       );
+       ];
 
        /**
         * Private constructor, no instance is needed from this class as only
@@ -123,7 +123,7 @@ final class FrameworkBootstrap {
                if (is_null(self::$configurationInstance)) {
                        // Init new instance
                        self::$configurationInstance = new FrameworkConfiguration();
-               } // END - if
+               }
 
                // Return it
                return self::$configurationInstance;
@@ -142,7 +142,7 @@ final class FrameworkBootstrap {
                if (isset($_SERVER['HTTP_HOST'])) {
                        // Then it is a HTML response/request.
                        $requestType = 'html';
-               } // END - if
+               }
 
                // Return it
                return $requestType;
@@ -174,8 +174,8 @@ final class FrameworkBootstrap {
 
                                        // Abort lookup as it has been found in open_basedir
                                        break;
-                               } // END - if
-                       } // END - foreach
+                               }
+                       }
                } else {
                        // If open_basedir is not set, all is allowed
                        $isReachable = true;
@@ -226,7 +226,7 @@ final class FrameworkBootstrap {
                if (!self::isReadableFile($fileInstance)) {
                        // Abort here
                        throw new InvalidArgumentException(sprintf('Cannot find fileInstance.pathname=%s.', $fileInstance->getPathname()));
-               } // END - if
+               }
 
                // Load it
                require_once $fileInstance->getPathname();
@@ -292,9 +292,9 @@ final class FrameworkBootstrap {
         * @return      void
         */
        public static function prepareApplication () {
-               // Configuration entry 'detected_app_name' must be set, get it here, including full path
-               $application = self::getConfigurationInstance()->getConfigEntry('detected_app_name');
-               $fullPath    = self::getConfigurationInstance()->getConfigEntry('detected_full_app_path');
+               // Configuration entry '__detected_app_name' must be set, get it here, including full path
+               $application = self::getConfigurationInstance()->getConfigEntry('__detected_app_name');
+               $fullPath    = self::getConfigurationInstance()->getConfigEntry('__detected_full_app_path');
 
                /*
                 * Now check and load all files, found deprecated files will throw a
@@ -323,11 +323,11 @@ final class FrameworkBootstrap {
 
                                // Skip loading deprecated file
                                continue;
-                       } // END - if
+                       }
 
                        // Load it
                        self::loadInclude($fileInstance);
-               } // END - foreach
+               }
 
                // Scan for application's classes, exceptions and interfaces
                ClassLoader::scanApplicationClasses();
@@ -340,8 +340,8 @@ final class FrameworkBootstrap {
         * @return      void
         */
        public static function startApplication () {
-               // Configuration entry 'detected_app_name' must be set, get it here
-               $application = self::getConfigurationInstance()->getConfigEntry('detected_app_name');
+               // Configuration entry '__detected_app_name' must be set, get it here
+               $application = self::getConfigurationInstance()->getConfigEntry('__detected_app_name');
 
                // Is there an application helper instance?
                $applicationInstance = call_user_func_array(
@@ -377,7 +377,7 @@ final class FrameworkBootstrap {
 
                        // Call method
                        call_user_func(array($applicationInstance, $methodName));
-               } // END - foreach
+               }
        }
 
        /**
@@ -393,7 +393,7 @@ final class FrameworkBootstrap {
                if (self::getDatabaseInstance() instanceof DatabaseConnector) {
                        // Yes, then abort here
                        throw new BadMethodCallException('Method called twice.');
-               } // END - if
+               }
 
                // Initialize database layer
                $databaseInstance = ObjectFactory::createObjectByConfiguredName(self::getConfigurationInstance()->getConfigEntry('database_type') . '_class');
@@ -430,7 +430,7 @@ final class FrameworkBootstrap {
                                         * false as many other PHP functions are doing? ;-(
                                         */
                                        throw new UnknownHostnameException(sprintf('Cannot resolve "%s" to an IP address. Please fix your setup.', $_SERVER['SERVER_NAME']));
-                               } // END - if
+                               }
 
                                // Al fine, set it
                                self::$serverAddress = $serverIp;
@@ -438,7 +438,7 @@ final class FrameworkBootstrap {
                                // Run auto-detecting through console tools lib
                                self::$serverAddress = ConsoleTools::acquireSelfIpAddress();
                        }
-               } // END - if
+               }
 
                // Return it
                return self::$serverAddress;
@@ -508,7 +508,7 @@ final class FrameworkBootstrap {
                if (self::isHttpSecured()) {
                        // Add the >s< for HTTPS
                        $protocol = 'https';
-               } // END - if
+               }
 
                // Construct the full URL and secure it against CSRF attacks
                $baseUrl = sprintf('%s://%s%s', $protocol, self::detectDomain(), self::detectScriptPath());
@@ -530,7 +530,7 @@ final class FrameworkBootstrap {
                if (isset($_SERVER['SERVER_NAME'])) {
                        // Detect the full domain
                        $fullDomain = htmlentities(strip_tags($_SERVER['SERVER_NAME']), ENT_QUOTES);
-               } // END - if
+               }
 
                // Return it
                return $fullDomain;
@@ -550,7 +550,7 @@ final class FrameworkBootstrap {
                if (isset($_SERVER['SCRIPT_NAME'])) {
                        // Get dirname from it and replace back-slashes with slashes for lame OSes...
                        $scriptPath = str_replace("\\", '/', dirname($_SERVER['SCRIPT_NAME']));
-               } // END - if
+               }
 
                // Return it
                return $scriptPath;
@@ -601,7 +601,7 @@ final class FrameworkBootstrap {
                        // Then use it
                        $request = strtolower($requestInstance->getRequestElement('request'));
                        $requestType = $request;
-               } // END - if
+               }
 
                // ... and a new response object
                $responseClass = sprintf('Org\Mxchange\CoreFramework\Response\%sResponse', StringUtils::convertToClassName($request));
@@ -625,7 +625,7 @@ final class FrameworkBootstrap {
                         * application (by user).
                         */
                        ApplicationEntryPoint::exitApplication('No application specified. Please provide a parameter "app" and retry.');
-               } // END - if
+               }
 
                // Get it for local usage
                $application = self::getRequestInstance()->getRequestElement('app');
@@ -649,11 +649,11 @@ final class FrameworkBootstrap {
                if ((!is_dir($applicationPath)) || (!is_readable($applicationPath))) {
                        // Not found or not readable
                        ApplicationEntryPoint::exitApplication(sprintf('Application "%s" not found.', $application));
-               } // END - if
+               }
 
                // Set the detected application's name and full path for later usage
-               self::getConfigurationInstance()->setConfigEntry('detected_full_app_path', $applicationPath);
-               self::getConfigurationInstance()->setConfigEntry('detected_app_name'     , $application);
+               self::getConfigurationInstance()->setConfigEntry('__detected_full_app_path', $applicationPath);
+               self::getConfigurationInstance()->setConfigEntry('__detected_app_name'     , $application);
        }
 
        /**