From: Roland Häder Date: Wed, 11 Jun 2008 22:36:18 +0000 (+0000) Subject: Class loader does now include extra configs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=21ce3472c2e72011ab362292d7e7a83c304f0859;p=hub.git Class loader does now include extra configs --- diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 79e9f05ce..348a8e039 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -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]