"; echo "PBI Auto-Build (i386) outgoing directory"; if ( "$ver" == "8" ) { echo " - (PCBSD 9.x)

"; } else if ( "$ver" == 9) { echo " - (PCBSD 9.x)

"; } echo "
Sort by Alphabetical - Date"; //$listing[1500]; //$listingTime[1500]; $i=0; $sort = $_GET['sort']; $founddirs="1"; //running the while loop while ($file = readdir($dir_handle)) { if ( "$file" != ".." and "${file}" != "." and is_dir($file)) { $newpath = "$path" . "/" . "$file"; $subdir_handle = @opendir($newpath) or die("Unable to open $newpath" ); //$listing[$i] = "$file"; //running the while loop while ($subfile = readdir($subdir_handle)) { if ( "$subfile" != ".." and "${subfile}" != "." and is_dir($file)) { if ( file_exists("$file/$subfile/build.time") ) { $listing["${file}/${subfile}"] = filemtime("$file/$subfile/build.time"); $founddirs="0"; } else { //$listing["${file}/${subfile}"] = 0; //$founddirs="0"; } } } $i++; } } //closing the directory closedir($dir_handle); if ( $founddirs == "1" ) { die("

No PBIs available"); } if ( "$sort" == "alph" ) { ksort($listing); } else { // Sort by date arsort($listing); } echo ""; echo ""; $COLOR="#FFFFFF"; $j=0; foreach ( $listing as $key => $val ) { $workingdir = $key; if ( file_exists("$workingdir/build.time") ) { $last_modified = filemtime("$workingdir/build.time"); if ( "$ver" == "9" ) { $verfile="pbi-version"; } else { $verfile=".built"; } // Get the directory status for each module if ( file_exists("$workingdir/$verfile") and filesize("$workingdir/$verfile") != 0 ) { $statusfile= fopen("$workingdir/$verfile", "r"); $pbiver = fread($statusfile, filesize("$workingdir/$verfile")); fclose($statusfile); if ( strlen($pbiver) > 15) { $pbiver = substr($pbiver, 0, 15); } $pbiver = rtrim($pbiver, "\n"); $vercolor="#990000"; $vercolor="#000000"; } else { $pbiver="Unknown"; $vercolor="#990000"; } if ( "$ver" == "9" ) { if ( file_exists("$workingdir/pbi-result") ) { $statusfile= fopen("$workingdir/pbi-result", "r"); $buildstatus = fread($statusfile, filesize("$workingdir/pbi-result")); fclose($statusfile); $buildstatus = rtrim($buildstatus, "\n"); $buildcolor="#990000"; if ( "$buildstatus" == "OK" ) $buildcolor="#003300"; } else { $buildstatus="Unknown"; $buildcolor="#990000"; } } else { // Get the build status for each module if ( file_exists("$workingdir/.buildfailed") ) { $buildstatus="FAILED"; $buildcolor="#990000"; } else if (file_exists("$workingdir/.buildgood") ) { $buildstatus="Success"; $buildcolor="#003300"; } else { $buildstatus="Unknown"; $buildcolor="#990000"; } } // Echo out the finished line echo "\n"; } else { echo ""; echo "\n"; } $j++; if ($COLOR == "#99CCFF" ) { $COLOR="#FFFFFF"; } else { $COLOR="#99CCFF"; } } echo "
Module:Version:Build Status:Last Built:Subversion
$workingdir$pbiver$buildstatus"; echo date("m/d/Y - h:ia", $last_modified); echo "svn
$workingdir
svn
"; ?>