[rrd-developers] Suggestion for API extension

Tobias Oetiker tobi at oetiker.ch
Sat Aug 8 11:49:25 CEST 2009


Hi Benny,

Jul 30 Benny Baumann wrote:

> Hi,
>
> I recently discovered the PHP extension for RRDTool which is available
> as a contribution to RRDTool. This extension runs successfully with
> latest PHP5, but misses some functions of current RRDTool releases (no
> rrd_dump, no rrd_info). I'm currently working on updating the PHP
> extension to also include these operations.
>
> And here comes the issue: The RRDTool library is more or less written to
> be used in the command line interface thus either returns only single
> values or dumps output to a file\terminal. For the PHP extension I need
> output to be written into a buffer though.
>
> To solve this I suggest adding a callback interface to e.g. rrd_dump
> that is called whenever string data (or binary data) has to be returned.
> An example implementation for rrd_dump_opt_cb_r can be found in the
> attached patch. Feedback appreciated. IDK if this patch is complete and
> if the mentioned rrd_dump_opt_cb_r function is properly exported; but at
> least dumping should work.
>
> The basic rrd_dump_opt_r now calls this Callback method internally to
> give an example of how this callback interface can be used and to avoid
> duplicate source.

the patch seems sane to me from looking at your code ... I will be
glad to include it if you can provide a version that applies to

  svn://svn.oetiker.ch/rrdtool/trunk/program

also you should add a section to doc/librrd.pod explaining this new
access method ...

cheers
tobi

>
> Regards,
> BenBE.
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-developers mailing list