0) { ?> eclipse-build downloads \n"; echo "

eclipse-build downloads

"; sort($files); foreach ($files as $file) { $cnt++; if ($file != ".htaccess" && false===strpos($file,"index.") && $file != "CVS") { if (is_file($file)) { $downloadSize = filesize("$file"); # Files larger than 200 kB or .zip files are # automatically directed to mirrors. Otherwise, # show them directly on download.eclipse (ex. # test result HTML files, md5sums) if (preg_match("/.+\.(txt|xml|html|log|md5|cfg)$/","$file") || $downloadSize < (200*1024)) { echo ' • ' . $file. ' (' . pretty_size($downloadSize) . ')'; } else { echo ' • ' . $file. ' (' . pretty_size($downloadSize) . ')'; } } else { echo ' • ' . $file. ''; } } } echo "\n"; } else { echo "No files found!"; } print "

 

"; function loadDirSimple($dir,$ext,$type) { // 1D array $stuff = array(); if (is_dir($dir) && is_readable($dir)) { $handle=opendir($dir); while (($file = readdir($handle))!==false) { if ( ($ext=="" || preg_match("/".$ext."$/",$file)) && $file!=".." && $file!=".") { if (($type=="f" && is_file($file)) || ($type=="d" && is_dir($file))) { $stuff[] = "$file"; } } } closedir($handle); } return $stuff; } function pretty_size($bytes) { $sufs = array("B", "K", "M", "G", "T", "P"); //we shouldn't be larger than 999.9 petabytes any time soon, hopefully $suf = 0; while($bytes >= 1000) { $bytes /= 1024; $suf++; } return sprintf("%3.1f%s", $bytes, $sufs[$suf]); } ?>