cvs: php-gcov-web(SOC06) /cron graph.php
| From: | Nuno Lopes | Date: | Thu, 07 Sep 2006 18:35:54 +0000 |
| Subject: | cvs: php-gcov-web(SOC06) /cron graph.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-32384@lists.php.net to get a copy of this message | ||
nlopess Thu Sep 7 18:35:54 2006 UTC
Modified files: (Branch: SOC06)
/php-gcov-web/cron graph.php
Log:
WS fixes. also ensure that the graphs dir existgs before writing to it
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/graph.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-gcov-web/cron/graph.php
diff -u php-gcov-web/cron/graph.php:1.1.2.2 php-gcov-web/cron/graph.php:1.1.2.3
--- php-gcov-web/cron/graph.php:1.1.2.2 Mon Aug 21 04:02:24 2006
+++ php-gcov-web/cron/graph.php Thu Sep 7 18:35:53 2006
@@ -13,14 +13,10 @@
if(!defined('CRON_PHP'))
{
- echo basename($_SERVER['PHP_SELF']).': Sorry this file must be called by a cron
script.'."\n";
- exit;
+ die(basename($_SERVER['PHP_SELF']).": Sorry this file must be called by a cron
script.\n");
}
-include_once 'config.php';
-
include_once 'lib/jpgraph/jpgraph.php';
-
include_once 'lib/jpgraph/jpgraph_line.php';
/*
@@ -42,6 +38,9 @@
$graph_days = 7;
}
+// make sure the directory exists
+@mkdir("$outdir/graphs");
+
// Make sure an acceptable graph mode is selected before continuing
if($graph_days > 0)
{
@@ -71,18 +70,18 @@
$current_date = date('M d');
$graph_array = array(
- array('name' => 'codecoverage',
- 'title' => 'Code Coverage',
- 'yformat' => 'percent'),
+ array('name' => 'codecoverage',
+ 'title' => 'Code Coverage',
+ 'yformat' => 'percent'),
array('name' => 'failures',
- 'title' => 'Test Failures',
- 'yformat' => 'integer'),
- array('name' => 'memleaks',
- 'title' => 'Memory Leaks',
- 'yformat' => 'integer'),
+ 'title' => 'Test Failures',
+ 'yformat' => 'integer'),
+ array('name' => 'memleaks',
+ 'title' => 'Memory Leaks',
+ 'yformat' => 'integer'),
array('name' => 'warnings',
- 'title' => 'Compile Warnings',
- 'yformat' => 'integer')
+ 'title' => 'Compile Warnings',
+ 'yformat' => 'integer')
);
while($row = $stmt->fetch())
@@ -147,16 +146,15 @@
// Output the graph to a file location
$graph->Stroke($graph_filename);
- } // End check for number of data points on the graph
- else
- echo "graph.php: graph of mode $curgraph[name] had an insufficient number of valid data
points.\n";
+ } // End check for number of data points on the graph
+ else
+ echo "graph.php: graph of mode $curgraph[name] had an insufficient number of valid data
points.\n";
} // End looping each graph type
- echo "graph.php: completed this graph mode\n";
+ echo "graph.php: completed the $graph_mode graph mode\n";
} // End check that number of rows > 1
else
{
- //echo 'insufficient number of data rows'."\n";
echo "graph.php: has insufficent data rows to make these graphs for $version_id \n";
}
}