]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/config/class_FrameworkConfiguration.php
Minor code improvements:
[shipsimu.git] / inc / config / class_FrameworkConfiguration.php
index 74c9416c91fc28c62e9bbfefd171c06cf9c5882f..117836175e37a674285e571e74cbe88c861a1a6a 100644 (file)
@@ -133,14 +133,14 @@ class FrameworkConfiguration implements Registerable {
 
                                // Is the file name really set?
                                if (!empty($inc)) {
+                                       // Base path is by default added
+                                       $fqfn = $inc;
+
                                        // Base path added? (Uni* / Windows)
                                        if ((substr($inc, 0, 1) != "/") && (substr($inc, 1, 1) != ":")) {
                                                // Generate FQFN
                                                $fqfn = sprintf("%s/inc/extra/%s", PATH, $inc);
-                                       } else {
-                                               // Base path is already added
-                                               $fqfn = $inc;
-                                       }
+                                       } // END - if
                                } // END - if
 
                                // Include them all here
@@ -157,18 +157,15 @@ class FrameworkConfiguration implements Registerable {
         */
        public function defineDatabaseType ($type) {
                // Is it defined or not?
-               if (!defined('_DB_TYPE')) {
-                       // Cast to string
-                       $type = (string) $type;
-
-                       // Set the constant
-                       define('_DB_TYPE', $type);
-               } else {
+               if (defined('_DB_TYPE')) {
                        // Already defined! But we cannot throw an exception here... :(
                        ApplicationEntryPoint::app_die(sprintf("[%s:] Please define the database type only once in your application!",
                                __CLASS__
                        ));
                }
+
+               // Set the constant
+               define('_DB_TYPE', (string) $type);
        }
 
        /**
@@ -190,15 +187,15 @@ class FrameworkConfiguration implements Registerable {
                        ApplicationEntryPoint::app_die(sprintf("[%s:] Invalid path (not found) specified. Please make sure it is created.",
                                __CLASS__
                        ));
-               } elseif (!defined('PATH')) {
-                       // Set the constant
-                       define('PATH', $path);
-               } else {
+               } elseif (defined('PATH')) {
                        // Already defined! But we cannot throw an exception here... :(
                        ApplicationEntryPoint::app_die(sprintf("[%s:] Please define the local file path only once in your application.",
                                __CLASS__
                        ));
                }
+
+               // Define path here
+               define('PATH', $path);
        }
 
        /**