]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/registry/class_Registry.php
Rewrite of initInstance(), more eval() rewritten to call_user_func_array()
[shipsimu.git] / inc / classes / main / registry / class_Registry.php
index a9e1a2a723ab9b93cfccb5f0d384c67663479a8e..a8abb509266f09293349f4562f675c380566f6d5 100644 (file)
@@ -27,6 +27,11 @@ class Registry extends BaseFrameworkSystem implements Register {
         */
        private static $selfInstance = null;
 
+       /**
+        * Wether the registry is initialized
+        */
+       private static $initialized = false;
+
        /**
         * Instance registry
         */
@@ -68,6 +73,22 @@ class Registry extends BaseFrameworkSystem implements Register {
                return self::$selfInstance;
        }
 
+       /**
+        * Checks or sets wether the registry has been initialized. This had only be done once
+        *
+        * @param       $initialized    Wether the registry is initialized
+        * @return      $initialized    Wether the registry is initialized
+        */
+       public final static function isInitialized ($initialized = null) {
+               if (is_null($initialized)) {
+                       // Get status if initialized
+                       return self::$initialized;
+               } elseif (!is_null($initialized)) {
+                       // Registry is initialized!
+                       self::$initialized = true;
+               }
+       }
+
        /**
         * Checks wether an instance key was found
         *