// -> Library - Code by David Ferreira (djthyrax) $library=array(); $library["basedir"] = f("lib/"); $library["handle"] = opendir($library["basedir"]); while(false !== ($file = readdir($library["handle"]))){ if($file!="." && $file!=".."){ if(is_dir($file)){ $library["dirs"][]=$file; ## To be worked in the future }else{ $fileinfo = pathinfo($library["basedir"].$file); if(strtolower($fileinfo['extension'])!="php"){ $library["files"]["notphp"][]=$file; }else{ $library["files"]["php"][]=$file; } } } } closedir($library["handle"]); unset($library["handle"]); if(!empty($library["files"]["php"])){ internalHeader("Libraries"); foreach($library["files"]["php"] as $filename){ intMsg("-> ".$filename); include $library["basedir"].$filename; } $library["loaded"]=$library["files"]["php"]; if(!empty($library["files"]["notphp"])){ $library["nonloaded"]=$library["files"]["notphp"]; intMsg("-> Some files weren't included because they aren't .php"); } }