Commit: 889c0ccf42fffd9c5824dd73455e267988ec0e37 Author: v-maf...@microsoft.com <v-maf...@microsoft.com> Mon, 24 Mar 2014 09:31:26 -0700 Parents: 9a523c2fe3531b8964986a74f8d7a9becc2f5272 Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=889c0ccf42fffd9c5824dd73455e267988ec0e37 Log: Publish PFTT Reports Changed paths: M build.php M list_builds.php M pftt.php M pftt_report.php Diff: diff --git a/build.php b/build.php index d9c7d46..0789261 100755 --- a/build.php +++ b/build.php @@ -7,16 +7,10 @@ $revision = $_GET['revision']; if (substr($branch, 0, 3)!='PHP') { $branch = "PHP_5_6"; } -if (substr($revision, 0, 1)!='r') { +if (substr($revision, 0, 1)!='r' and strpos($revision, ".")===FALSE) { $revision = ""; } -if (!isset($build_type)) { - $build_type = "Unknown"; -} -if (!isset($cpu)) { - $cpu = "Unknown"; -} include("include/functions.php"); @@ -36,7 +30,7 @@ common_header(); <table> <tr> - <td><?php echo $branch; ?> <?php echo $revision; ?> <?php echo $build_type; ?> <?php echo $cpu; ?></td> + <td><?php echo $branch; ?> <?php echo $revision; ?> </td> </tr> </table> @@ -46,18 +40,15 @@ common_header(); <table> <tr> - <td><strong>PHPT</strong> <a href="howto_phpt.htm" target="_blank">How to</a></td> + <td><strong>PHPT</strong> <a href="howto_phpt.html" target="_blank">How to</a></td> </tr> <?php - var_dump(BASE_REPORT_DIR); - var_dump(BASE_REPORT_DIR."/$branch/$revision"); - var_dump(scandir(BASE_REPORT_DIR."/$branch/$revision")); foreach ( scandir(BASE_REPORT_DIR."/$branch/$revision") as $report ) { if (substr($report, 0, 4)=="PHPT" && is_file(BASE_REPORT_DIR."/$branch/$revision/$report")) { ?> <tr> - <td>with <a href="<?php echo dirname($_SERVER['PHP_SELF']); ?>/reports/db/<?php echo $branch; ?>/<?php echo $revision; ?>/<?php echo $report; ?>" target="_blank"><?php echo $report; ?></a></td> + <td>with <a href="/reports/db/<?php echo $branch; ?>/<?php echo $revision; ?>/<?php echo $report; ?>" target="_blank"><?php echo $report; ?></a></td> </tr> <?php @@ -69,7 +60,7 @@ foreach ( scandir(BASE_REPORT_DIR."/$branch/$revision") as $report ) { <br/> <table> <tr> - <td><strong>PhpUnit</strong> <a href="howto_phpunit.htm" target="_blank">How to</a></td> + <td><strong>PhpUnit</strong> <a href="howto_phpunit.html" target="_blank">How to</a></td> </tr> <?php @@ -78,7 +69,7 @@ foreach ( scandir(BASE_REPORT_DIR."/$branch/$revision") as $report ) { ?> <tr> - <td>with <a href="<?php echo dirname($_SERVER['PHP_SELF']); ?>/reports/db/<?php echo $branch; ?>/<?php echo $revision; ?>/<?php echo $report; ?>" target="_blank"><?php echo $report; ?></a></td> + <td>with <a href="/reports/db/<?php echo $branch; ?>/<?php echo $revision; ?>/<?php echo $report; ?>" target="_blank"><?php echo $report; ?></a></td> </tr> <?php diff --git a/list_builds.php b/list_builds.php index bd14181..56c5c7f 100755 --- a/list_builds.php +++ b/list_builds.php @@ -1,5 +1,4 @@ <?php -error_reporting(E_ALL); define('BASE_REPORT_DIR', dirname($_SERVER['SCRIPT_FILENAME'])."/reports/db/"); $branch = $_GET['branch']; @@ -17,6 +16,8 @@ $SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__)); common_header(); +// TODO include info about PFTT, link to download build of PFTT + ?> <h1><a href="pftt.php"><?php echo $branch; ?></a></h1> @@ -25,7 +26,7 @@ common_header(); $latest_revision = ''; $mtime = 0; -/* + foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) { if ($revision=="." or $revision=="..") continue; @@ -36,7 +37,7 @@ foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) { $latest_revision_mtime = $mtime; } } -}*/ +} ?> <table> @@ -53,7 +54,7 @@ foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) { <table> <?php -/*foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) { +foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) { if ($revision=="." or $revision=="..") continue; if (is_dir(BASE_REPORT_DIR."/$branch/$revision")) { @@ -66,7 +67,7 @@ foreach ( scandir(BASE_REPORT_DIR."/$branch") as $revision ) { <?php } // end if -} */ +} ?> diff --git a/pftt.php b/pftt.php index ca608ba..d301e57 100755 --- a/pftt.php +++ b/pftt.php @@ -16,10 +16,7 @@ define('BASE_REPORT_DIR', dirname($_SERVER['SCRIPT_FILENAME'])."/reports/db/"); <p>Choose a PHP Branch</p> <?php -var_dump(BASE_REPORT_DIR); -var_dump(dirname($_SERVER['SCRIPT_FILENAME'])); -/*$branches = scandir(BASE_REPORT_DIR); -var_dump($branches); +$branches = scandir(BASE_REPORT_DIR); if ($branches!==FALSE) { foreach ( $branches as $branch ) { if ($branch=="." or $branch=="..") @@ -53,7 +50,7 @@ if ($branches!==FALSE) { } // end if } -}*/ +} common_footer(); ?> \ No newline at end of file diff --git a/pftt_report.php b/pftt_report.php index 2530f05..3f9a080 100755 --- a/pftt_report.php +++ b/pftt_report.php @@ -10,10 +10,10 @@ // // the report file will either be for PHPT or PhpUnit reports generated by PFTT (see: git.php.net/pftt2.git ) // -// reports are stored as flat-files in pftt-reports/$branch/$revision (this is just a simple file upload script) +// reports are stored as flat-files in reports/db/$branch/$revision (this is just a simple file upload script) // // -// INSTALL NOTE: web server user needs write access to `pftt-reports` directory +// INSTALL NOTE: web server user needs write access to `reports/db` directory // // the report file is pre-generated by PFTT and uploaded, instead of generating the report on upload // or generating it when the user wants to view it. this is done because: @@ -86,8 +86,8 @@ if (substr($file_contents, 0, 6)!="<html>" or strpos($file_contents, "PFTT")===F // PhpUnit_CMP_PHP_5_5-r31d67bd-NTS-X64-VC11_Local-FileSystem_CLI_Symfony_v_PHP_5_5-rda84f3a-N.html // $report_name = trim($_FILES['report_file']['name']); -if (strlen($report_name) > 80) { - $report_name = substr($report_name, 0, 80); +if (strlen($report_name) > 100) { + $report_name = substr($report_name, 0, 100); } if (substr($report_name, -5) != ".html") { $report_name .= ".html"; @@ -98,29 +98,13 @@ $report_file = dirname($_SERVER['SCRIPT_FILENAME']) . "/reports/db/$branch/$revi $report_dir = dirname($report_file); // ensure dir exists -//mkdir($report_dir, 0666, TRUE); -$a = ""; -$b = explode("/", $report_dir); -var_dump($b); -foreach ($b as $c) { - $a .= "/" . $c; - var_dump($a); - if (!is_dir($a)) - mkdir($a, 0777); -} - -$fh = fopen($report_file."_", "w"); -fwrite($fh, "<html>hello</html>"); -fclose($fh); +mkdir($report_dir, 0777, TRUE); // report_file is stored locally in a temporary file, move that file to the permanent location move_uploaded_file($_FILES['report_file']['tmp_name'], $report_file); -echo "Parent dir content:"; -var_dump(scandir(dirname($report_dir))); - -echo "Parent-Parent dir content:"; -var_dump(scandir(dirname(dirname($report_dir)))); +echo "Dir Content:"; +var_dump(scandir($report_dir)); // done, successfully echo "Uploaded to $report_file"; -- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php