cvs: php-gcov-web /cron check_parameters.php compile_results.php cron.php template.php valgrind.php /www compile_results.php graph.php params.php
site.api.php skip.php tests.php valgrind.php viewer.php

From: Date: Thu, 21 Dec 2006 23:19:03 +0000
Subject: cvs: php-gcov-web /cron check_parameters.php compile_results.php cron.php template.php valgrind.php /www compile_results.php graph.php params.php
site.api.php skip.php tests.php valgrind.php viewer.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-33581@lists.php.net to get a copy of this message
nlopess Thu Dec 21 23:19:03 2006 UTC Added files: /php-gcov-web/www compile_results.php params.php valgrind.php Removed files: /php-gcov-web/cron template.php Modified files: /php-gcov-web/cron check_parameters.php compile_results.php cron.php valgrind.php /php-gcov-web/www graph.php site.api.php skip.php tests.php viewer.php Log: finalize the cron job upgrading and their correspodnent web page viewer

http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/check_parameters.php?r1=1.2&r2=1.3&diff_format=u Index: php-gcov-web/cron/check_parameters.php diff -u php-gcov-web/cron/check_parameters.php:1.2 php-gcov-web/cron/check_parameters.php:1.3 --- php-gcov-web/cron/check_parameters.php:1.2 Tue Dec 19 15:52:09 2006 +++ php-gcov-web/cron/check_parameters.php Thu Dec 21 23:19:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: check_parameters.php,v 1.2 2006/12/19 15:52:09 nlopess Exp $ */ +/* $Id: check_parameters.php,v 1.3 2006/12/21 23:19:03 nlopess Exp $ */ // check for zend_parse_parameters*() and related functions usage // TODO: add support for zend_get_parameters*() @@ -58,12 +58,12 @@ $API_params['U'] = $API_params['u']; } -$errors = array(); +$check_params = array(); /** reports an error, according to its level */ function error($str, $level = 0) { - global $current_file, $current_function, $line, $errors, $phpdir; + global $current_file, $current_function, $line, $check_params, $phpdir; if ($level <= REPORT_LEVEL) { if (strpos($current_file, $phpdir) === 0) { @@ -71,7 +71,7 @@ } else { $filename = $current_file; } - $errors[$filename][] = array($line, $current_function, $str); + $check_params[$filename][] = array($line, $current_function, $str); } } @@ -342,72 +342,13 @@ // this script produces the same results on all machines, so don't run it on non-master servers -if($is_master) -{ - recurse($phpdir); - - if ($errors) { - $total = 0; - $output = <<< HTML -<table border="1"> - <tr> - <td>File</td> - <td>Number of detected problems</td> - </tr> -HTML; - - // $errors[$filename][] = array($line, $function, $str); - foreach ($errors as $filename => $err) { - $dir = dirname($filename); - $hash = 'c' . md5($filename); - $count = count($err); - - $total += $count; - - if(substr($filename, 0, 5) == 'Zend/') { - $lxrpath = str_replace('Zend/','ZendEngine2/', $filename); - $lxrpath = "http://lxr.php.net/source{$lxrpath}#"; - } else { - $lxrpath = "http://lxr.php.net/source/php-src/{$filename}#"; - } - +if ($is_master) { - $output .= <<< HTML - <tr> - <td><a href="viewer.php?version=$phpver&func=params&file=$hash">$filename</a></td> - <td>$count</td> - </tr> -HTML; - - $file = '<?php $filename="'.basename($filename).'"; ?>'.<<< HTML - -<table border="1"> - <tr> - <td>Function</td> - <td>Line</td> - <td>Message</td> - </tr> -HTML; - - foreach ($err as $error) { - - $file .= <<< HTML - <tr> - <td>$error[1]</td> - <td><a href="{$lxrpath}{$error[0]}">$error[0]</a></td> - <td>$error[2]</td> - </tr> -HTML; - } - $file .= '</table>'.html_footer(); - file_put_contents("$outdir/$hash.inc", $file); - } - - $output = "<p>Total: $total</p>\n$output</table>\n"; + recurse($phpdir); - } else { - $output = "<p>Congratulations! Currently no problems were found!</p>\n"; - } + // sort by filename + ksort($check_params); - file_put_contents("$outdir/params.inc", $output.html_footer()); + file_put_contents("$outdir/check_params.inc", serialize($check_params)); } + http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/compile_results.php?r1=1.4&r2=1.5&diff_format=u Index: php-gcov-web/cron/compile_results.php diff -u php-gcov-web/cron/compile_results.php:1.4 php-gcov-web/cron/compile_results.php:1.5 --- php-gcov-web/cron/compile_results.php:1.4 Tue Dec 19 21:42:16 2006 +++ php-gcov-web/cron/compile_results.php Thu Dec 21 23:19:03 2006 @@ -18,202 +18,57 @@ +----------------------------------------------------------------------+ */ -/* $Id: compile_results.php,v 1.4 2006/12/19 21:42:16 nlopess Exp $ */ +/* $Id: compile_results.php,v 1.5 2006/12/21 23:19:03 nlopess Exp $ */ // Compile Results generation script -if(!defined('CRON_PHP')) -{ - echo basename($_SERVER['PHP_SELF']).': Sorry this file must be called by a cron script.'."\n"; - exit; -} - -$totalnumerrors = 0; -$totalnumwarnings = 0; - $data = file_get_contents("$tmpdir/php_build.log"); // Check if build file was readable, and if not, notify the user -if($data === false) -{ - echo basename($_SERVER['PHP_SELF']).": it appears the build process has succeeded but the PHP build log file at $tmpdir/php_build.log could not be opened for processing. If the problem persists, you may want to check the permissions for the cron scripts in the temporary directory to ensure that the user that runs the cron scripts has at least read and write access for the directory $tmpdir and all files contained within this directory.\n"; +if ($data === false) { + die("compile_results.php: it appears the build process has succeeded but the PHP build log file at $tmpdir/php_build.log could not be opened for processing.\n"); +} + + +// Regular expression to select the error and warning information +// tuned for gcc 3.4, 4.0 and 4.1 +$gcc_regex = '/^((.+)(\(\.text\+0x[[:xdigit:]]+\))?: In function [`\'](\w+)\':\s+)?'. + '((?(1)(?(3)[^:\n]+|\2)|[^:\n]+)):(\d+): (?:(error|warning):\s+)?(.+)'. + str_repeat('(?:\s+\5:(\d+): (?:(error|warning):\s+)?(.+))?', 99). // capture up to 100 errors + '/mS'; + +preg_match_all($gcc_regex, $data, $data, PREG_SET_ORDER); + +$compile_results = array(); + +$phpdir_len = strlen($phpdir); +if ($phpdir[$phpdir_len-1] != '/') { + $phpdir_strip_len = $phpdir_len + 1; // remove the trailing slash } -else -{ - // Regular expression to select the error and warning information - // tuned for gcc 3.4, 4.0 and 4.1 - $gcc_regex = '/^((.+)(\(\.text\+0x[[:xdigit:]]+\))?: In function [`\'](\w+)\':\s+)?'. - '((?(1)(?(3)[^:\n]+|\2)|[^:\n]+)):(\d+): (?:(error|warning):\s+)?(.+)'. - str_repeat('(?:\s+\5:(\d+): (?:(error|warning):\s+)?(.+))?', 99). // capture up to 100 errors - '/mS'; - - preg_match_all($gcc_regex, $data, $data, PREG_SET_ORDER); - - $stats = array(); - - $index_write = ''; - - foreach ($data as $error) - { - - $file = $error[5]; - - // Remove the phpdir portion from the file path if it occurs - if(substr($file, 0, strlen($phpdir)) == $phpdir) - { - $filepath = substr($file, strlen($phpdir)); - } - else - { - $filepath = $file; - } // End check for phpdir in file path - - // If stats are not previously set for this file, initialize it to the default values - if(!isset($stats[$file])) - { - @$stats[$file][0] = 0; // number of file errros - @$stats[$file][1] = 0; // number of file warnings - @$stats[$file][2] = ''; // data to write - } - - $function = $error[4] ? $error[4] : '(top level)'; - $write = ''; - - // the real data starts at 6th element - for ($i = 6; isset($error[$i]); $i += 3) - { - $line = $error[$i]; - $type = $error[$i+1] ? $error[$i+1] : 'error'; // warning or error (default) - $msg = $error[$i+2]; - - $lxrpath = ''; - - // This section only applies to the master server - if($is_master) - { - if(substr($filepath, 0, 6) == '/Zend/') - { - $lxrpath = str_replace('/Zend/','/ZendEngine2/', $filepath); - $lxrpath = "http://lxr.php.net/source{$lxrpath}#{$line}"; - } - else - { - $lxrpath = "http://lxr.php.net/source/php-src{$filepath}#{$line}"; - } - - $write .= <<< HTML - <tr> - <td>$function</td> - <td><a href="$lxrpath">$line</a></td> - <td>$type: $msg</td> - </tr> -HTML; - if($type == 'error') - { - @++$stats[$file][0]; // number of file errros - ++$totalnumerrors; - } - elseif($type == 'warning') - { - @++$stats[$file][1]; // number of file warnings - ++$totalnumwarnings; - } - else - { - } // End check for type - - } // End check if master server - else - { - $compile_result = array(); - $compile_result['file'] = $filepath; - $compile_result['function'] = $function; - $compile_result['line'] = $line; - $compile_result['type'] = $type; - $compile_result['msg'] = $msg; - - $xmlarray['compile_results'][] = $compile_result; - } // End check for client machine - - } // End loop through the number of elements in a single result file - - @$stats[$file][2] .= $write; // data to write - - } // End loop through the compile results - - // Continue check for master server - if($is_master) - { - $total = $totalnumerrors+$totalnumwarnings; - if ($total) - { - $index_write .= <<< HTML - -<p>Number of Errors: {$totalnumerrors}<br /> -Number of Warnings: {$totalnumwarnings}<br /> -Total: {$total}</p> - -<table border="1"> -<tr> -<th>File</th> -<th>Number of errors</th> -<th>Number of warnings</th> -</tr> -HTML; - } else { - $index_write = "<p>Congratulations! There are no compiler warnings/errors.</p>\n"; - } - } // End check for master server - - foreach ($stats as $file => $data) - { - $hash = md5($file); // files have consistent start character - - // Compare first portion of file name to phpsrc - if(substr($file, 0, strlen($phpdir)) == $phpdir) - { - $short_file = substr($file, strlen($phpdir)); - } - else // If phpsrc does not occur, display full file name (todo: verify) - { - $short_file = $file; - } - - if($is_master) - { - // Add content to the core compile results file - $index_write .= <<< HTML -<tr> -<td><a href="viewer.php?version=$phpver&func=compile_results&file=$hash">$short_file</a></td> -<td>$data[0]</td> -<td>$data[1]</td> -</tr> -HTML; - - // Add content to the individual compile results file - $write = <<< HTML -<table border="1"> - <tr> - <th>Function</th> - <th>Line</th> - <th>Message</th> - </tr> -HTML; - - file_put_contents("$outdir/$hash.inc", - '<?php $filename="'.basename($file).'"; ?>'. - $write.$data[2].'</table>'.html_footer()); - } // End check for master server - - } // End loop through errors and warnings - - if($is_master) - { - file_put_contents("$outdir/compile_results.inc", - $index_write.'</table>'.html_footer()); - } // End final check for master server +foreach ($data as $error) { + + $file = $error[5]; + $function = $error[4] ? $error[4] : '(top level)'; + + // Remove the phpdir portion from the file path if it occurs + if (substr($file, 0, $phpdir_len) == $phpdir) { + $filepath = substr($file, $phpdir_strip_len); + } else { + $filepath = $file; + } + + // the real data starts at 6th element + for ($i = 6; isset($error[$i]); $i += 3) { + $line = $error[$i]; + $type = $error[$i+1] ? $error[$i+1] : 'error'; // warning or error (default) + $msg = $error[$i+2]; + + $compile_results[$filepath][] = array($function, $line, $type, $msg); + } +} -} // End check if data could be read +// sort by filename +ksort($compile_results); -?> +file_put_contents("$outdir/compile_results.inc", serialize($compile_results)); http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.php?r1=1.4&r2=1.5&diff_format=u Index: php-gcov-web/cron/cron.php diff -u php-gcov-web/cron/cron.php:1.4 php-gcov-web/cron/cron.php:1.5 --- php-gcov-web/cron/cron.php:1.4 Tue Dec 19 18:42:06 2006 +++ php-gcov-web/cron/cron.php Thu Dec 21 23:19:03 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cron.php,v 1.4 2006/12/19 18:42:06 nlopess Exp $ */ +/* $Id: cron.php,v 1.5 2006/12/21 23:19:03 nlopess Exp $ */ if ($argc != 7) @@ -64,7 +64,6 @@ } require $workdir.'/config.php'; -require $workdir.'/template.php'; require $workdir.'/system.php'; require $workdir.'/compile_results.php'; require $workdir.'/check_parameters.php'; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/valgrind.php?r1=1.2&r2=1.3&diff_format=u Index: php-gcov-web/cron/valgrind.php diff -u php-gcov-web/cron/valgrind.php:1.2 php-gcov-web/cron/valgrind.php:1.3 --- php-gcov-web/cron/valgrind.php:1.2 Tue Dec 19 15:52:09 2006 +++ php-gcov-web/cron/valgrind.php Thu Dec 21 23:19:03 2006 @@ -18,47 +18,18 @@ +----------------------------------------------------------------------+ */ -/* $Id: valgrind.php,v 1.2 2006/12/19 15:52:09 nlopess Exp $ */ +/* $Id: valgrind.php,v 1.3 2006/12/21 23:19:03 nlopess Exp $ */ // File to process memory leaks detected by valgrind -if(!defined('CRON_PHP')) -{ - echo basename($_SERVER['PHP_SELF']).': Sorry this file must be called by a cron script.'."\n"; - exit; -} - // $data: contains the contents of $tmpdir/php_test.log -// Output for core file -$index_write = ''; - -// Output for individual files -$write = ''; - -// Regular expression to select leaks for both unicode and not $leak_re = '/LEAK(:(?P<testtype>[a-z|A-Z]))? (?P<title>.+) \[(?P<file>[^\]]+)\]/'; - -// Find memory leaks in the data preg_match_all($leak_re, $data, $leaks, PREG_SET_ORDER); -// Clear the old directory variable -$old_dir = ''; +$valgrind = array(); -// If there are no leaks just notify that no leaks occurred -if (count($leaks) < 1) -{ - $index_write .= "<p>Congratulations! Currently no memory leaks were found!</p>\n"; -} -else -{ - $totalnumleaks = count($leaks); - $index_write .= '<table border="1">'."\n"; -} // End check for number of leaks - -// Loop through each result -foreach ($leaks as $test) -{ +foreach ($leaks as $test) { $base = "$phpdir/".substr($test['file'],0,-4); @@ -67,92 +38,20 @@ $title = $test['title']; if(isset($test['testtype']) && strtolower($test['testtype']) == 'u') { - $testtype = 'Unicode'; + $type = 'Unicode'; $report_file = $base.'u.mem'; } else { - $testtype = 'Native'; + $type = 'Native'; $report_file = $base.'mem'; } - $hash = 'v' . md5($report_file); - - // Check if master server - if($is_master) - { - if ($old_dir != $dir) - { - $old_dir = $dir; - - $index_write .= <<< HTML -<tr> -<td colspan="3" align="center"><b>$dir</b></td> -</tr> -<tr> -<td width="190">File</td> -<td width="100">Test Type</td> -<td width="*">Name</td> -</tr> -HTML; - - } // End check for directory change - - // Add the test to valgrind main page output - $index_write .= <<< HTML -<tr> -<td><a href="viewer.php?version=$phpver&func=valgrind&file=$hash">$file</a></td> -<td>$testtype</td> -<td>$title</td> -</tr> -HTML; - - } // End check for master server - - $script_php = highlight_file($base.'php', true); - $report = str_replace($phpdir, '', file_get_contents($report_file)); - - if($is_master) - { - $write = <<< HTML -<h2>Script</h2> -<pre>$script_php</pre> -<h2>Report</h2> -<pre>$report</pre> -HTML; - - // Output content for the individual test page - file_put_contents("$outdir/$hash.inc", - '<?php $filename="'.basename($file).'"; ?>'."\n" - .$write. - html_footer() - ); - - } - else - { - // If not master server, add the leak to the output array - $newleak = array(); - $newleak['testtype'] = $testtype; - $newleak['title'] = $test['title']; - $newleak['file'] = $test['file']; - $newleak['script'] = $script_text; - $newleak['report'] = $report; - $xmlarray['valgrind'][] = $newleak; - - } // End check for master server - -} // End loop through each leak - -// End check for master server -if($is_master) -{ - if (count($leaks) > 0) - { - $index_write .= "</table>\n"; - } + $report = @file_get_contents($report_file); + $script = @file_get_contents($base.'php'); - file_put_contents("$outdir/valgrind.inc", - $index_write.html_footer()); + $valgrind[$test['file']] = array($title, $type, $script, $report); +} -} // End check for master server +// sort by filename +ksort($valgrind); -?> +file_put_contents("$outdir/valgrind.inc", serialize($valgrind)); http://cvs.php.net/viewvc.cgi/php-gcov-web/www/graph.php?r1=1.1&r2=1.2&diff_format=u Index: php-gcov-web/www/graph.php diff -u php-gcov-web/www/graph.php:1.1 php-gcov-web/www/graph.php:1.2 --- php-gcov-web/www/graph.php:1.1 Thu Dec 21 18:58:49 2006 +++ php-gcov-web/www/graph.php Thu Dec 21 23:19:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: graph.php,v 1.1 2006/12/21 18:58:49 nlopess Exp $ */ +/* $Id: graph.php,v 1.2 2006/12/21 23:19:03 nlopess Exp $ */ if (!defined('IN_GCOV_CODE')) exit; @@ -61,10 +61,6 @@ } } else { - $appvars['page']['title'] = 'PHP: '.$version.' Graphs'; - $appvars['page']['head'] = 'Graphs'; - $appvars['page']['headtitle'] = $version; - $content .= <<< HTML <p>Select the period of time you wish to view as a graphical progression:</p> HTML; http://cvs.php.net/viewvc.cgi/php-gcov-web/www/site.api.php?r1=1.3&r2=1.4&diff_format=u Index: php-gcov-web/www/site.api.php diff -u php-gcov-web/www/site.api.php:1.3 php-gcov-web/www/site.api.php:1.4 --- php-gcov-web/www/site.api.php:1.3 Thu Dec 21 18:58:49 2006 +++ php-gcov-web/www/site.api.php Thu Dec 21 23:19:03 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: site.api.php,v 1.3 2006/12/21 18:58:49 nlopess Exp $ */ +/* $Id: site.api.php,v 1.4 2006/12/21 23:19:03 nlopess Exp $ */ // File: Core Site API File // Desc: contains core display functions, it is essential for all pages to include this file. @@ -283,3 +283,27 @@ HTML; } + + +function make_lxr_link($path, $line) +{ + if (strpos($path, 'Zend/') !== false) { + $path = str_replace('Zend/','ZendEngine2/', $path); + return "http://lxr.php.net/source/{$path}#{$line}"; + } else { + return "http://lxr.php.net/source/php-src/{$path}#{$line}"; + } +} + + +function make_cvs_link($path, $line) +{ + $cvsbranch = str_replace('PHP_HEAD', 'HEAD', $GLOBALS['version']); + return "http://cvs.php.net/viewvc.cgi/php-src/$path?view=annotate&amp;pathrev=$cvsbranch#l$line"; +} + + +function make_lxr_func_link($func) +{ + return "http://lxr.php.net/ident?i=$func"; +} http://cvs.php.net/viewvc.cgi/php-gcov-web/www/skip.php?r1=1.1&r2=1.2&diff_format=u Index: php-gcov-web/www/skip.php diff -u php-gcov-web/www/skip.php:1.1 php-gcov-web/www/skip.php:1.2 --- php-gcov-web/www/skip.php:1.1 Thu Dec 21 18:58:49 2006 +++ php-gcov-web/www/skip.php Thu Dec 21 23:19:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: skip.php,v 1.1 2006/12/21 18:58:49 nlopess Exp $ */ +/* $Id: skip.php,v 1.2 2006/12/21 23:19:03 nlopess Exp $ */ if (!defined('IN_GCOV_CODE')) exit; @@ -65,7 +65,7 @@ $dir = dirname($path); $file = basename($path); $urlfile = htmlspecialchars(urlencode($path)); - $reason = $entry[1] ? $entry[1] : '(no reason given)'; + $reason = htmlspecialchars($entry[1] ? $entry[1] : '(no reason given)'); if ($dir !== $old_dir) { $old_dir = $dir; http://cvs.php.net/viewvc.cgi/php-gcov-web/www/tests.php?r1=1.1&r2=1.2&diff_format=u Index: php-gcov-web/www/tests.php diff -u php-gcov-web/www/tests.php:1.1 php-gcov-web/www/tests.php:1.2 --- php-gcov-web/www/tests.php:1.1 Thu Dec 21 18:58:49 2006 +++ php-gcov-web/www/tests.php Thu Dec 21 23:19:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tests.php,v 1.1 2006/12/21 18:58:49 nlopess Exp $ */ +/* $Id: tests.php,v 1.2 2006/12/21 23:19:03 nlopess Exp $ */ if (!defined('IN_GCOV_CODE')) exit; @@ -72,7 +72,7 @@ $file = basename($path); $urlfile = htmlspecialchars(urlencode($path)); $type = $entry[0]; - $title = $entry[1]; + $title = htmlspecialchars($entry[1]); if ($dir !== $old_dir) { $old_dir = $dir; http://cvs.php.net/viewvc.cgi/php-gcov-web/www/viewer.php?r1=1.4&r2=1.5&diff_format=u Index: php-gcov-web/www/viewer.php diff -u php-gcov-web/www/viewer.php:1.4 php-gcov-web/www/viewer.php:1.5 --- php-gcov-web/www/viewer.php:1.4 Thu Dec 21 18:58:49 2006 +++ php-gcov-web/www/viewer.php Thu Dec 21 23:19:03 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: viewer.php,v 1.4 2006/12/21 18:58:49 nlopess Exp $ */ +/* $Id: viewer.php,v 1.5 2006/12/21 23:19:03 nlopess Exp $ */ // Name: GCOV Viewer page // Desc: page for view PHP version information such as code coverage @@ -90,8 +90,8 @@ ), 'valgrind' => array( - 'pagetitle' => 'PHP: Valgrind Report for '.$version, - 'pagehead' => 'Valgrind Report' + 'pagetitle' => 'PHP: Valgrind Reports for '.$version, + 'pagehead' => 'Valgrind Reports' ), ); http://cvs.php.net/viewvc.cgi/php-gcov-web/www/compile_results.php?view=markup&rev=1.1 Index: php-gcov-web/www/compile_results.php +++ php-gcov-web/www/compile_results.php <?php /* +----------------------------------------------------------------------+ | PHP QA GCOV Website | +----------------------------------------------------------------------+ | Copyright (c) 2005-2006 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Nuno Lopes <nlopess@php.net> | +----------------------------------------------------------------------+ */ /* $Id: compile_results.php,v 1.1 2006/12/21 23:19:03 nlopess Exp $ */ if (!defined('IN_GCOV_CODE')) exit; $inputfile = "./$version/compile_results.inc"; $raw_data = @file_get_contents($inputfile); $data = unserialize($raw_data); $stats = array('warning' => 0, 'error' => 0); if (!$raw_data) { $content = "<p>Sorry, but this data isn't available at this time.</p>"; return; } elseif ($data) { $content = <<< HTML <table border="1"> HTML; foreach ($data as $path => $fileentry) { $content .= <<< HTML <tr> <td colspan="3" align="center"><b>$path</b></td> </tr> <tr> <td><b>Line</b></td> <td><b>Function</b></td> <td><b>Message</b></td> </tr> HTML; foreach ($fileentry as $entry) { $function = $entry[0]; $line = $entry[1]; $type = $entry[2]; $msg = htmlspecialchars($entry[3]); $lxrlink = make_lxr_link($path, $line); $cvslink = make_cvs_link($path, $line); $funclink = make_lxr_func_link($function); ++$stats[$type]; $content .= <<< HTML <tr> <td><a href="$cvslink">$line</a> <a href="$lxrlink">[lxr]</a></td> <td><a href="$funclink">$function</a></td> <td>$type: $msg</td> </tr> HTML; } } $total = $stats['warning'] + $stats['error']; $content = <<< HTML <p>Number of Errors: $stats[error]<br /> Number of Warnings: $stats[warning]<br /> Total: $total</p> $content </table> <p><strong>Note</strong>: the lxr links are made against the HEAD branch, and thus the line numbers may be incorrect.</p> HTML; } else { $content = "<p>Congratulations! Currently there are no compiler warnings/errors!</p>\n"; } $content .= footer_timestamp(@filemtime($inputfile)); http://cvs.php.net/viewvc.cgi/php-gcov-web/www/params.php?view=markup&rev=1.1 Index: php-gcov-web/www/params.php +++ php-gcov-web/www/params.php <?php /* +----------------------------------------------------------------------+ | PHP QA GCOV Website | +----------------------------------------------------------------------+ | Copyright (c) 2005-2006 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Nuno Lopes <nlopess@php.net> | +----------------------------------------------------------------------+ */ /* $Id: params.php,v 1.1 2006/12/21 23:19:03 nlopess Exp $ */ if (!defined('IN_GCOV_CODE')) exit; $inputfile = "./$version/check_params.inc"; $raw_data = @file_get_contents($inputfile); $data = unserialize($raw_data); $total = 0; if (!$raw_data) { $content = "<p>Sorry, but this data isn't available at this time.</p>"; return; } elseif ($data) { $content = <<< HTML <table border="1"> HTML; foreach ($data as $path => $fileentry) { $content .= <<< HTML <tr> <td colspan="3" align="center"><b>$path</b></td> </tr> <tr> <td><b>Line</b></td> <td><b>Function</b></td> <td><b>Message</b></td> </tr> HTML; foreach ($fileentry as $entry) { $line = $entry[0]; $function = $entry[1]; $msg = htmlspecialchars($entry[2]); $lxrlink = make_lxr_link($path, $line); $cvslink = make_cvs_link($path, $line); ++$total; $content .= <<< HTML <tr> <td><a href="$cvslink">$line</a> <a href="$lxrlink">[lxr]</a></td> <td>$function</td> <td>$msg</td> </tr> HTML; } } $content = <<< HTML <p><b>$total possible problems found:</b></p> $content </table> <p><strong>Note</strong>: the lxr links are made against the HEAD branch, and thus the line numbers may be incorrect.</p> HTML; } else { $content = "<p>Congratulations! Currently there are no compiler warnings/errors!</p>\n"; } $content .= footer_timestamp(@filemtime($inputfile)); http://cvs.php.net/viewvc.cgi/php-gcov-web/www/valgrind.php?view=markup&rev=1.1 Index: php-gcov-web/www/valgrind.php +++ php-gcov-web/www/valgrind.php <?php /* +----------------------------------------------------------------------+ | PHP QA GCOV Website | +----------------------------------------------------------------------+ | Copyright (c) 2005-2006 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Nuno Lopes <nlopess@php.net> | +----------------------------------------------------------------------+ */ /* $Id: valgrind.php,v 1.1 2006/12/21 23:19:03 nlopess Exp $ */ if (!defined('IN_GCOV_CODE')) exit; $inputfile = "./$version/valgrind.inc"; $raw_data = @file_get_contents($inputfile); $data = unserialize($raw_data); $old_dir = ''; if (!$raw_data) { $content = "<p>Sorry, but this data isn't available at this time.</p>"; return; } elseif (isset($_GET['file'])) { $file = $_GET['file']; $appvars['page']['title'] = "PHP: $version Valgrind Report for $file"; $appvars['page']['head'] = "Valgrind Report for $file"; if (isset($data[$file])) { $data = $data[$file]; $script = highlight_string($data[2], true); $report = htmlspecialchars($data[3]); $content = <<< HTML <h2>Script</h2> $script <h2>Report</h2> <pre>$report</pre> HTML; } else { $content = "<p>Invalid file ID.</p>\n"; } } elseif ($data) { $content = '<p><b>'.count($data) . " valgrind reports:</b></p>\n"; $content .= <<< HTML <table border="1"> HTML; foreach ($data as $path => $entry) { $dir = dirname($path); $file = basename($path); $urlfile = htmlspecialchars(urlencode($path)); $title = htmlspecialchars($entry[0]); $type = $entry[1]; if ($dir !== $old_dir) { $old_dir = $dir; $content .= <<< HTML <tr> <td colspan="3" align="center"><b>$dir</b></td> </tr> <tr> <td><b>File</b></td> <td><b>Type</b></td> <td><b>Name</b></td> </tr> HTML; } $content .= <<< HTML <tr> <td><a href="/viewer.php?version=$version&amp;func=valgrind&amp;file=$urlfile">$file</a></td> <td>$type</td> <td>$title</td> </tr> HTML; } $content .= <<< HTML </table> HTML; } else { $content = "<p>Congratulations! Currently there are no valgrind reports!</p>\n"; } $content .= footer_timestamp(@filemtime($inputfile));
« previous php.mirrors (#33581) next »