File: FAQ

package info (click to toggle)
php4-rrdtool 1.04-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,168 kB
  • ctags: 85
  • sloc: sh: 9,365; ansic: 356; php: 102; makefile: 72; awk: 43
file content (29 lines) | stat: -rw-r--r-- 872 bytes parent folder | download
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
# $Id: FAQ,v 1.1 2001/11/27 16:35:20 joeym Exp joeym $
#


Q:  I would like the rrd_graph() function to output the generated image
    to stdout.  IE: something along the lines:
        rrd_graph("-", $opts, count($opts));
            or
        rrd_graph("php://stdout", $opts, count($opts));

A:  There currently is no way for the php4-rrdtool module to handle this.
There are a couple of possibile avenues of approach for adding this to
php4-rrdtool, but those will come at a later date after more testing
to find the best method is done.

In the meantime, it is possible to achieve the desired effect:

<? 
  php Header("Content-type: image/gif");                                         

  $opts = ....;

  $f = tempnam("/tmp","rrd");
  $ret = rrd_graph($f, $opts, count($opts));
  readfile($f);
  unlink($f);
?>

Thanks to Konrad Riedel for the above contribution.