cvs: php-gcov-web(SOC06) /cron cron.sh lcov_epilog.inc lcov_prolog.inc /www .htaccess config.php gcov_epilog.inc gcov_prolog.inc index.php robots.txt
site.api.php viewer.php
| From: | Nuno Lopes | Date: | Sun, 10 Sep 2006 15:12:01 +0000 |
| Subject: | cvs: php-gcov-web(SOC06) /cron cron.sh lcov_epilog.inc lcov_prolog.inc /www .htaccess config.php gcov_epilog.inc gcov_prolog.inc index.php robots.txt site.api.php viewer.php |
||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-32439@lists.php.net to get a copy of this message | ||
nlopess Sun Sep 10 15:12:01 2006 UTC
Added files: (Branch: SOC06)
/php-gcov-web/cron lcov_epilog.inc lcov_prolog.inc
Removed files:
/php-gcov-web/www gcov_epilog.inc gcov_prolog.inc robots.txt
Modified files:
/php-gcov-web/cron cron.sh
/php-gcov-web/www .htaccess config.php index.php site.api.php
viewer.php
Log:
make lcov coverage work
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.sh?r1=1.1.2.12&r2=1.1.2.13&diff_format=u Index: php-gcov-web/cron/cron.sh diff -u php-gcov-web/cron/cron.sh:1.1.2.12 php-gcov-web/cron/cron.sh:1.1.2.13 --- php-gcov-web/cron/cron.sh:1.1.2.12 Sun Sep 10 11:48:38 2006 +++ php-gcov-web/cron/cron.sh Sun Sep 10 15:12:01 2006 @@ -9,6 +9,9 @@ WORKDIR=`dirname "$0"` echo "$WORKDIR" | grep -q '^/' || WORKDIR="`pwd`/$WORKDIR" # get absolute path +# make genhtml use our header/footer +export LTP_GENHTML="genhtml --html-prolog ${WORKDIR}/lcov_prolog.inc --html-epilog ${WORKDIR}/lcov_epilog.inc --html-extension php" + # set up a one dimensional array to store all php version information declare -a TAGS_ARRAY TAGS_ARRAY=( `cat "$FILENAME"` ) http://cvs.php.net/viewvc.cgi/php-gcov-web/www/.htaccess?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/www/.htaccess diff -u php-gcov-web/www/.htaccess:1.1.2.2 php-gcov-web/www/.htaccess:1.1.2.3 --- php-gcov-web/www/.htaccess:1.1.2.2 Sat Sep 2 22:57:42 2006 +++ php-gcov-web/www/.htaccess Sun Sep 10 15:12:01 2006 @@ -1,4 +1,4 @@ -Options +FollowSymLinks +Options +FollowSymLinks -Indexes <IfModule mod_dir.c> DirectoryIndex index.php http://cvs.php.net/viewvc.cgi/php-gcov-web/www/config.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-gcov-web/www/config.php diff -u php-gcov-web/www/config.php:1.1.2.4 php-gcov-web/www/config.php:1.1.2.5 --- php-gcov-web/www/config.php:1.1.2.4 Sat Sep 2 18:38:45 2006 +++ php-gcov-web/www/config.php Sun Sep 10 15:12:01 2006 @@ -12,10 +12,10 @@ $appvars['page'] = array(); // Application page-specific variable array // Define the file that contains the text for each PHP version -$appvars['site']['tagsfile'] = '../cron/tags.inc'; +$appvars['site']['tagsfile'] = dirname(__FILE__).'/../cron/tags.inc'; // Define the file that contains all needed database connections -$appvars['site']['dbcsfile'] = '../cron/database.php'; +$appvars['site']['dbcsfile'] = dirname(__FILE__).'/../cron/database.php'; // Define links for the side bar (used in site.api.php) $appvars['site']['sidebarsubitems_localbuilds'] = array( http://cvs.php.net/viewvc.cgi/php-gcov-web/www/index.php?r1=1.1.2.8&r2=1.1.2.9&diff_format=u Index: php-gcov-web/www/index.php diff -u php-gcov-web/www/index.php:1.1.2.8 php-gcov-web/www/index.php:1.1.2.9 --- php-gcov-web/www/index.php:1.1.2.8 Thu Sep 7 17:50:40 2006 +++ php-gcov-web/www/index.php Sun Sep 10 15:12:01 2006 @@ -47,7 +47,7 @@ list($version_name, $version_last_build_time, $version_last_attempted_build_date, $version_last_successful_build_date) = $row; echo "<tr>"; - echo "<th align='left'><a href='viewer.php?version=$version_name'>$version_name</a></th>"; + echo "<th align='left'><a href='/viewer.php?version=$version_name'>$version_name</a></th>"; echo '<td>'.$version_last_attempted_build_date.'</td>'."\n"; echo '<td>'.$version_last_successful_build_date.'</td>'."\n"; echo '<td>'.time_diff($version_last_build_time).'</td>'."\n"; http://cvs.php.net/viewvc.cgi/php-gcov-web/www/site.api.php?r1=1.1.2.9&r2=1.1.2.10&diff_format=u Index: php-gcov-web/www/site.api.php diff -u php-gcov-web/www/site.api.php:1.1.2.9 php-gcov-web/www/site.api.php:1.1.2.10 --- php-gcov-web/www/site.api.php:1.1.2.9 Thu Sep 7 17:26:30 2006 +++ php-gcov-web/www/site.api.php Sun Sep 10 15:12:01 2006 @@ -74,8 +74,17 @@ echo 'PHP: Test and Code Coverage Analysis'; } ?></title> -<link rel="stylesheet" href="style.css" /> -<link rel="shortcut icon" href="favicon.ico" /> +<link rel="stylesheet" href="/style.css" /> +<?php + +if (isset($appvars['page']['css'])) { + foreach ($appvars['page']['css'] as $css) { + echo '<link rel="stylesheet" href="'.$css.'" />'; + } +} + +?> +<link rel="shortcut icon" href="/favicon.ico" /> </head> <body bgcolor="#ffffff" text="#000000" link="#000099" alink="#0000ff" vlink="#000099"> <?php // end content from header.inc ?> @@ -103,9 +112,9 @@ <tr bgcolor="#9999cc"> <td align="right" valign="bottom"><img src="/images/spacer.gif" width="1" height="15" border="0" alt="" /><a href="http://php.net/downloads.php" class="header small">downloads</a> | <a href="http://qa.php.net" class="header small">QA</a> | <a href="http://php.net/docs.php" class="header small">documentation</a> | <a href="http://php.net/FAQ.php" class="header small">faq</a> | <a href="http://php.net/support.php" class="header small">getting help</a> | <a href="http://php.net/mailing-lists.php" class="header small">mailing lists</a> | <a href="http://bugs.php.net/" class="header small">reporting bugs</a> | <a href="http://php.net/sites.php" class="header small">php.net sites</a> | <a href="http://php.net/links.php" class="header small">links</a> | <a href="http://php.net/my.php" class="header small">my php.net</a> </td> </tr> -<tr><td colspan="2" bgcolor="#000000" height="1"><img src="gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> +<tr><td colspan="2" bgcolor="#000000" height="1"><img src="/gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> <tr><td colspan="2" bgcolor="#7777cc" class="header small"> </td></tr> -<tr><td colspan="2" bgcolor="#000000" height="1"><img src="gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> +<tr><td colspan="2" bgcolor="#000000" height="1"><img src="/gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> </table> <!-- end header --> @@ -149,7 +158,7 @@ $cls = " class='$cls'"; } - echo "<li$cls><a href='viewer.php?version=$tag'>$tag</a></li>\n"; + echo "<li$cls><a href='/viewer.php?version=$tag'>$tag</a></li>\n"; } if (isset($appvars['site']['mytag'])) @@ -177,9 +186,9 @@ $link = ''; if(isset($appvars['site']['builderusername'])) - $link = "<li$cls><a href='viewer.php?username={$appvars['site']['builderusername']}&version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; + $link = "<li$cls><a href='/viewer.php?username={$appvars['site']['builderusername']}&version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; else - $link = "<li$cls><a href='viewer.php?version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; + $link = "<li$cls><a href='/viewer.php?version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; echo $link; } http://cvs.php.net/viewvc.cgi/php-gcov-web/www/viewer.php?r1=1.1.2.12&r2=1.1.2.13&diff_format=u Index: php-gcov-web/www/viewer.php diff -u php-gcov-web/www/viewer.php:1.1.2.12 php-gcov-web/www/viewer.php:1.1.2.13 --- php-gcov-web/www/viewer.php:1.1.2.12 Thu Sep 7 15:53:53 2006 +++ php-gcov-web/www/viewer.php Sun Sep 10 15:12:01 2006 @@ -14,7 +14,7 @@ $error = ''; // Start by assuming no error has occurred $fileroot = ''; // base directory for including external files (used for external builds) -$file = isset($_REQUEST['file']) ? $_REQUEST['file'] : ''; +$file = isset($_REQUEST['file']) ? basename($_REQUEST['file']) : ''; $version = isset($_REQUEST['version']) ? $_REQUEST['version'] : ''; $mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; @@ -36,7 +36,7 @@ 'compile_results' => array( 'option' => 'phpinc', - 'pagetitle' => 'PHP: Compile Results for '.$version, + 'pagetitle' => 'PHP: Compile Results for '.$version, 'pagehead' => 'Compile Results' ), // todo: remove php_test_log @@ -48,14 +48,14 @@ ), 'valgrind' => array( - 'option' => 'phpinc', // or text at this point - 'pagetitle' => 'PHP: Valgrind Report for '.$version, + 'option' => 'phpinc', + 'pagetitle' => 'PHP: Valgrind Report for '.$version, 'pagehead' => 'Valgrind Report' ), 'tests' => array( 'option' => 'phpinc', - 'pagetitle' => 'PHP: Test Failures for '.$version, + 'pagetitle' => 'PHP: Test Failures for '.$version, 'pagehead' => 'Test Failures' ), 'system' => @@ -195,7 +195,7 @@ elseif (isset($func_array[$func])) { - $incfile = $file ? basename($file) : $func; + $incfile = $file ? $file : $func; // Determine the file path $filepath = $fileroot.$version.'/'.$incfile.'.inc'; @@ -293,10 +293,12 @@ $appvars['page']['head'] = $version.': Code Coverage Report'; $appvars['page']['headtitle'] = $version; - // Collect file content - $content = 'content for code coverage would be here.'; - - // todo: if there is no lcov content, inform user here + if (@is_dir("$version/lcov_html")) { + header("Location: /$version/lcov_html/"); + exit; + } else { + $content = "Sorry, but the lcov data isn't available at this time."; + } } else if($func == 'menu') { http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/lcov_epilog.inc?view=markup&rev=1.1 Index: php-gcov-web/cron/lcov_epilog.inc +++ php-gcov-web/cron/lcov_epilog.inc http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/lcov_prolog.inc?view=markup&rev=1.1 Index: php-gcov-web/cron/lcov_prolog.inc +++ php-gcov-web/cron/lcov_prolog.inc
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.sh?r1=1.1.2.12&r2=1.1.2.13&diff_format=u Index: php-gcov-web/cron/cron.sh diff -u php-gcov-web/cron/cron.sh:1.1.2.12 php-gcov-web/cron/cron.sh:1.1.2.13 --- php-gcov-web/cron/cron.sh:1.1.2.12 Sun Sep 10 11:48:38 2006 +++ php-gcov-web/cron/cron.sh Sun Sep 10 15:12:01 2006 @@ -9,6 +9,9 @@ WORKDIR=`dirname "$0"` echo "$WORKDIR" | grep -q '^/' || WORKDIR="`pwd`/$WORKDIR" # get absolute path +# make genhtml use our header/footer +export LTP_GENHTML="genhtml --html-prolog ${WORKDIR}/lcov_prolog.inc --html-epilog ${WORKDIR}/lcov_epilog.inc --html-extension php" + # set up a one dimensional array to store all php version information declare -a TAGS_ARRAY TAGS_ARRAY=( `cat "$FILENAME"` ) http://cvs.php.net/viewvc.cgi/php-gcov-web/www/.htaccess?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/www/.htaccess diff -u php-gcov-web/www/.htaccess:1.1.2.2 php-gcov-web/www/.htaccess:1.1.2.3 --- php-gcov-web/www/.htaccess:1.1.2.2 Sat Sep 2 22:57:42 2006 +++ php-gcov-web/www/.htaccess Sun Sep 10 15:12:01 2006 @@ -1,4 +1,4 @@ -Options +FollowSymLinks +Options +FollowSymLinks -Indexes <IfModule mod_dir.c> DirectoryIndex index.php http://cvs.php.net/viewvc.cgi/php-gcov-web/www/config.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-gcov-web/www/config.php diff -u php-gcov-web/www/config.php:1.1.2.4 php-gcov-web/www/config.php:1.1.2.5 --- php-gcov-web/www/config.php:1.1.2.4 Sat Sep 2 18:38:45 2006 +++ php-gcov-web/www/config.php Sun Sep 10 15:12:01 2006 @@ -12,10 +12,10 @@ $appvars['page'] = array(); // Application page-specific variable array // Define the file that contains the text for each PHP version -$appvars['site']['tagsfile'] = '../cron/tags.inc'; +$appvars['site']['tagsfile'] = dirname(__FILE__).'/../cron/tags.inc'; // Define the file that contains all needed database connections -$appvars['site']['dbcsfile'] = '../cron/database.php'; +$appvars['site']['dbcsfile'] = dirname(__FILE__).'/../cron/database.php'; // Define links for the side bar (used in site.api.php) $appvars['site']['sidebarsubitems_localbuilds'] = array( http://cvs.php.net/viewvc.cgi/php-gcov-web/www/index.php?r1=1.1.2.8&r2=1.1.2.9&diff_format=u Index: php-gcov-web/www/index.php diff -u php-gcov-web/www/index.php:1.1.2.8 php-gcov-web/www/index.php:1.1.2.9 --- php-gcov-web/www/index.php:1.1.2.8 Thu Sep 7 17:50:40 2006 +++ php-gcov-web/www/index.php Sun Sep 10 15:12:01 2006 @@ -47,7 +47,7 @@ list($version_name, $version_last_build_time, $version_last_attempted_build_date, $version_last_successful_build_date) = $row; echo "<tr>"; - echo "<th align='left'><a href='viewer.php?version=$version_name'>$version_name</a></th>"; + echo "<th align='left'><a href='/viewer.php?version=$version_name'>$version_name</a></th>"; echo '<td>'.$version_last_attempted_build_date.'</td>'."\n"; echo '<td>'.$version_last_successful_build_date.'</td>'."\n"; echo '<td>'.time_diff($version_last_build_time).'</td>'."\n"; http://cvs.php.net/viewvc.cgi/php-gcov-web/www/site.api.php?r1=1.1.2.9&r2=1.1.2.10&diff_format=u Index: php-gcov-web/www/site.api.php diff -u php-gcov-web/www/site.api.php:1.1.2.9 php-gcov-web/www/site.api.php:1.1.2.10 --- php-gcov-web/www/site.api.php:1.1.2.9 Thu Sep 7 17:26:30 2006 +++ php-gcov-web/www/site.api.php Sun Sep 10 15:12:01 2006 @@ -74,8 +74,17 @@ echo 'PHP: Test and Code Coverage Analysis'; } ?></title> -<link rel="stylesheet" href="style.css" /> -<link rel="shortcut icon" href="favicon.ico" /> +<link rel="stylesheet" href="/style.css" /> +<?php + +if (isset($appvars['page']['css'])) { + foreach ($appvars['page']['css'] as $css) { + echo '<link rel="stylesheet" href="'.$css.'" />'; + } +} + +?> +<link rel="shortcut icon" href="/favicon.ico" /> </head> <body bgcolor="#ffffff" text="#000000" link="#000099" alink="#0000ff" vlink="#000099"> <?php // end content from header.inc ?> @@ -103,9 +112,9 @@ <tr bgcolor="#9999cc"> <td align="right" valign="bottom"><img src="/images/spacer.gif" width="1" height="15" border="0" alt="" /><a href="http://php.net/downloads.php" class="header small">downloads</a> | <a href="http://qa.php.net" class="header small">QA</a> | <a href="http://php.net/docs.php" class="header small">documentation</a> | <a href="http://php.net/FAQ.php" class="header small">faq</a> | <a href="http://php.net/support.php" class="header small">getting help</a> | <a href="http://php.net/mailing-lists.php" class="header small">mailing lists</a> | <a href="http://bugs.php.net/" class="header small">reporting bugs</a> | <a href="http://php.net/sites.php" class="header small">php.net sites</a> | <a href="http://php.net/links.php" class="header small">links</a> | <a href="http://php.net/my.php" class="header small">my php.net</a> </td> </tr> -<tr><td colspan="2" bgcolor="#000000" height="1"><img src="gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> +<tr><td colspan="2" bgcolor="#000000" height="1"><img src="/gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> <tr><td colspan="2" bgcolor="#7777cc" class="header small"> </td></tr> -<tr><td colspan="2" bgcolor="#000000" height="1"><img src="gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> +<tr><td colspan="2" bgcolor="#000000" height="1"><img src="/gfx/spacer.gif" width="1" height="1" border="0" alt="" /></td></tr> </table> <!-- end header --> @@ -149,7 +158,7 @@ $cls = " class='$cls'"; } - echo "<li$cls><a href='viewer.php?version=$tag'>$tag</a></li>\n"; + echo "<li$cls><a href='/viewer.php?version=$tag'>$tag</a></li>\n"; } if (isset($appvars['site']['mytag'])) @@ -177,9 +186,9 @@ $link = ''; if(isset($appvars['site']['builderusername'])) - $link = "<li$cls><a href='viewer.php?username={$appvars['site']['builderusername']}&version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; + $link = "<li$cls><a href='/viewer.php?username={$appvars['site']['builderusername']}&version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; else - $link = "<li$cls><a href='viewer.php?version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; + $link = "<li$cls><a href='/viewer.php?version={$appvars['site']['mytag']}&func=$href'>$item</a></li>\n"; echo $link; } http://cvs.php.net/viewvc.cgi/php-gcov-web/www/viewer.php?r1=1.1.2.12&r2=1.1.2.13&diff_format=u Index: php-gcov-web/www/viewer.php diff -u php-gcov-web/www/viewer.php:1.1.2.12 php-gcov-web/www/viewer.php:1.1.2.13 --- php-gcov-web/www/viewer.php:1.1.2.12 Thu Sep 7 15:53:53 2006 +++ php-gcov-web/www/viewer.php Sun Sep 10 15:12:01 2006 @@ -14,7 +14,7 @@ $error = ''; // Start by assuming no error has occurred $fileroot = ''; // base directory for including external files (used for external builds) -$file = isset($_REQUEST['file']) ? $_REQUEST['file'] : ''; +$file = isset($_REQUEST['file']) ? basename($_REQUEST['file']) : ''; $version = isset($_REQUEST['version']) ? $_REQUEST['version'] : ''; $mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : ''; @@ -36,7 +36,7 @@ 'compile_results' => array( 'option' => 'phpinc', - 'pagetitle' => 'PHP: Compile Results for '.$version, + 'pagetitle' => 'PHP: Compile Results for '.$version, 'pagehead' => 'Compile Results' ), // todo: remove php_test_log @@ -48,14 +48,14 @@ ), 'valgrind' => array( - 'option' => 'phpinc', // or text at this point - 'pagetitle' => 'PHP: Valgrind Report for '.$version, + 'option' => 'phpinc', + 'pagetitle' => 'PHP: Valgrind Report for '.$version, 'pagehead' => 'Valgrind Report' ), 'tests' => array( 'option' => 'phpinc', - 'pagetitle' => 'PHP: Test Failures for '.$version, + 'pagetitle' => 'PHP: Test Failures for '.$version, 'pagehead' => 'Test Failures' ), 'system' => @@ -195,7 +195,7 @@ elseif (isset($func_array[$func])) { - $incfile = $file ? basename($file) : $func; + $incfile = $file ? $file : $func; // Determine the file path $filepath = $fileroot.$version.'/'.$incfile.'.inc'; @@ -293,10 +293,12 @@ $appvars['page']['head'] = $version.': Code Coverage Report'; $appvars['page']['headtitle'] = $version; - // Collect file content - $content = 'content for code coverage would be here.'; - - // todo: if there is no lcov content, inform user here + if (@is_dir("$version/lcov_html")) { + header("Location: /$version/lcov_html/"); + exit; + } else { + $content = "Sorry, but the lcov data isn't available at this time."; + } } else if($func == 'menu') { http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/lcov_epilog.inc?view=markup&rev=1.1 Index: php-gcov-web/cron/lcov_epilog.inc +++ php-gcov-web/cron/lcov_epilog.inc http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/lcov_prolog.inc?view=markup&rev=1.1 Index: php-gcov-web/cron/lcov_prolog.inc +++ php-gcov-web/cron/lcov_prolog.inc