-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart.php
More file actions
48 lines (38 loc) · 1.22 KB
/
chart.php
File metadata and controls
48 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
Print dependency graphs for a selection of CIs.
Fixme: This should be a regular controller - no reason for a
special path for charts. Just leads to a bunch of code repetition and bugs. :-/
*/
require_once("config.php");
require_once("common/util/util.php");
require_once("common/util/db.php");
require_once("common/model.php");
require_once("model.php");
require_once("ciChart.php");
function main()
{
$format = param('format','svg');
if($format=='svg') {
header('Content-Type: image/svg+xml');
}
if (param('legend')) {
echo ciChart::renderLegend($format);
}
else {
$full = param('full',null);
$ci_id = param('id');
$ci_list = ci::fetch(array('id_arr'=>array($ci_id)));
$ci = $ci_list[$ci_id];
$c = new ciChart(($full=='yes')?'full':$ci,
param('mode','dependencies')!='dependencies',
param('highlight',array()),
param('steps'));
echo $c->render($format);
}
}
db::init(FC_DSN_DEFAULT) || die("The site is down. Reason: Could not connect to the database.");
db::query("set client_encoding to \"utf8\"");
ciUser::init();
main();
?>