]> git.mxchange.org Git - hub.git/commitdiff
Class loader does now include extra configs
authorRoland Häder <roland@mxchange.org>
Wed, 11 Jun 2008 22:36:18 +0000 (22:36 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 11 Jun 2008 22:36:18 +0000 (22:36 +0000)
inc/loader/class_ClassLoader.php

index 79e9f05ce1d9086fd7b057cc37ea356f493646ef..348a8e039672328820b9a12c785c7890a3890fbd 100644 (file)
@@ -280,9 +280,13 @@ class ClassLoader {
                // Load all classes from the config directory
                $this->loadClasses($basePath);
 
+               // Include these extra configs now
+               $this->includeExtraConfigs();
+
                // Set the prefix back
                $this->prefix = $oldPrefix;
                $this->prefixLen = strlen($this->prefix);
+
        }
 
        /**
@@ -312,6 +316,25 @@ class ClassLoader {
                        } // END - if
                } // END - if
        }
+
+       /**
+        * Includes all extra config files
+        *
+        * @return      void
+        */
+       private function includeExtraConfigs () {
+               // Run through all class names (should not be much)
+               foreach ($this->classes as $fileName=>$fqfn) {
+                       // Is this a config?
+                       if (substr($fileName, 0, $this->prefixLen) == $this->prefix) {
+                               // Then include it
+                               require($fqfn);
+
+                               // Remove it from the list
+                               unset($this->classes[$fileName]);
+                       } // END - if
+               } // END - foreach
+       }
 }
 
 // [EOF]