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