/** * Einen ganzen Ordner durchscannen und alle Klassen includen * * @param string $dir Der Ordner */ public static function addDir($dir) { if (!is_dir($dir)) { //throw new Exception; } // Schon eingescannt if (in_array($dir, self::$dirs)) { return; } self::$dirs[] = $dir; $files = scandir($dir); foreach ($files as $file) { if (in_array($file, ['.', '..'])) { continue; } if (strrchr($file, '.') != '.php') { continue; } // Ausgedachter Klassennamen self::addClass($dir . '_' . $file, $dir . DIRECTORY_SEPARATOR . $file); self::$isNewCache = true; } }