cvs: php-gcov-web(SOC06) /cron graph.php
| From: | Nuno Lopes | Date: | Thu, 30 Nov 2006 23:51:09 +0000 |
| Subject: | cvs: php-gcov-web(SOC06) /cron graph.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-33419@lists.php.net to get a copy of this message | ||
nlopess Thu Nov 30 23:51:09 2006 UTC
Modified files: (Branch: SOC06)
/php-gcov-web/cron graph.php
Log:
fix bug when the code coverage fails to produce data.
#not tested, but should work :P
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/graph.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u
Index: php-gcov-web/cron/graph.php
diff -u php-gcov-web/cron/graph.php:1.1.2.4 php-gcov-web/cron/graph.php:1.1.2.5
--- php-gcov-web/cron/graph.php:1.1.2.4 Sun Sep 10 15:28:52 2006
+++ php-gcov-web/cron/graph.php Thu Nov 30 23:51:09 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: graph.php,v 1.1.2.4 2006/09/10 15:28:52 nlopess Exp $ */
+/* $Id: graph.php,v 1.1.2.5 2006/11/30 23:51:09 nlopess Exp $ */
// File to generate graphs for a weekly or monthly basis
@@ -76,8 +76,6 @@
//$version_id = 0;
}
- $data_numrows = 0;
-
$data_x = array();
$data_y = array();
@@ -109,22 +107,25 @@
list($year, $month, $day) = explode('-', $build_date);
- $data_x[] = $day;
-
// Code Coverage less then 0 means could not be located
- if($build_codecoverage >= 0)
+ if($build_codecoverage >= 0) {
$data_y['codecoverage'][] = $build_codecoverage;
+ $data_x['codecoverage'][] = $day;
+ }
$data_y['failures'][] = $build_numfailures;
+ $data_x['failures'][] = $day;
+
$data_y['memleaks'][] = $build_numleaks;
- $data_y['warnings'][] = $build_numwarnings;
+ $data_x['memleaks'][] = $day;
- $data_numrows++;
+ $data_y['warnings'][] = $build_numwarnings;
+ $data_x['warnings'][] = $day;
} // Cycle through the results
// Ensure more than one data row exist for the period of time
- if($data_numrows > 1)
+ if(count($data_x))
{
// Create the graphs
foreach($graph_array as $curgraph)
@@ -154,7 +155,7 @@
// Add the plot to the graph
$graph->Add($lineplot);
$graph->xaxis->SetTitle('Day');
- $graph->xaxis->SetTickLabels($data_x);
+ $graph->xaxis->SetTickLabels($data_x[$curgraph['name']]);
$graph->xaxis->SetTextTickInterval(1);
if($curgraph['yformat'] == 'percent')