X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fclass_ClassLoader.php;h=79389f647d41688511137437c1472586e8c40455;hb=26cdd94d19490c1c461a5f20d5f08563bb0251f0;hp=cd065629b3db6e39fb9610b8ded76718d328165b;hpb=f1d358441b193b364d57788d660e6649d0229ca6;p=mailer.git diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index cd065629b3..79389f647d 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -212,7 +212,7 @@ class ClassLoader { //* DEBUG: */ print "Suffix=".$this->suffix."(".substr($dirClass2, -$this->sufLen, $this->sufLen).")\n"; //* DEBUG: */ print "ENTRY={$dirClass}\n"; if ( - (is_file($dirClass)) + (is_file($dirClass)) && (is_readable($dirClass)) && (substr($dirClass2, 0 , $this->preLen) == $this->prefix) && (substr($dirClass2, -$this->sufLen, $this->sufLen) == $this->suffix) @@ -262,6 +262,30 @@ class ClassLoader { $this->classes = new ArrayObject(); } } + + /** + * Load extra config files + * + * @return void + */ + public function loadExtraConfigs () { + // Backup old prefix + $oldPrefix = $this->prefix; + + // Set new prefix (temporary!) + $this->prefix = "config-"; + $this->preLen = strlen($this->prefix); + + // Set base directory + $basePath = sprintf("%sinc/config/", PATH); + + // Load all classes from the config directory + $this->loadClasses($basePath); + + // Set the prefix back + $this->prefix = $oldPrefix; + $this->preLen = strlen($this->prefix); + } } // Initial load of core classes and the FrameworkDirectoryPointer class