[rrd-developers] Preview for updated RRDTool PHP extension and userland wrapper

Dan Cech dcech at phpwerx.net
Mon Aug 24 16:43:37 CEST 2009


Benny,

I'm planning to check out this updated patch ASAP and will post my
comments as soon as I can.

One thing that occurred to me with the notes you made about requiring
particular versions of the rrdtool library is that it may make sense to
add a check to functions to either fall back to the older library (as is
currently used in rrd_graph.

Dan

Benny Baumann wrote:
> Hi,
> 
> I found some issues with yesterdays preview for the PHP extension and
> wrapper library that could cause a memory leak under certain conditions.
> They are fixed in this updated version
> 
> Also I added some more of RRDtools functions to the PHP extension
> (rrd_tune, rrd_first, rrd_restore) as well as completed the transition
> to skip the count of the options passed.
> 
> The interface to this updated PHP extension (should run with PHP4 and
> PHP5) now looks like this:
> 
> Declared consts (Used for the header type with rrd_dump):
> - RRD_DUMP_XML_NONE
> - RRD_DUMP_XML_DTD
> - RRD_DUMP_XML_XSD
> 
> /* {{{ proto mixed rrd_graph(string file, array args_arr)
>     Creates a graph based on options passed via an array */
> /* {{{ proto void rrd_clear_error(void)
>     Clear the error set by the last rrd tool function call */
> /* {{{ proto int rrd_update(string file, string opt)
>     Update an RRD file with values specified */
> /* {{{ proto int rrd_first(string file, [int index])
>     Gets first update time of an RRA */
> /* {{{ proto int rrd_last(string file)
>     Gets last update time of an RRD file */
> /* {{{ proto array rrd_info(string file)
>     Gets structural information of an RRD file */
> /* {{{ proto string rrd_dump(string file, [int header])
>     Gets an XML dump of an RRD file */
> /* {{{ proto array rrd_restore(string infile, string outfile)
>     Restores an RRD file from a XML dump */
> /* {{{ proto int rrd_create(string file, array args_arr)
>     Create an RRD file with the options passed (passed via array) */
> /* {{{ proto int rrd_tune(string file, array args_arr)
>     Tune an RRD file with the options passed (passed via array) */
> /* {{{ proto mixed rrdtool_info(bool as_array)
>     Provide some information about the RRD extension and the used library */
> /* {{{ proto string rrdtool_logo_guid()
>     Query the RRD Tool Logo GUID used to display the RRD Tool Logo */
> 
> Also some functions (rrd_last and rrd_first, as well as rrd_info) now
> use the _r-interface to access the rrd library, though in general this
> extension isn't thread-safe due to GetOpt used inside most functions
> (same problem as with the old API in general).
> 
> Compiling the PHP extension either using
> # phpize && ./configure && make && make install
> or as a PECL extension
> # pecl install package.xml
> 
> The userland wrapper library has been updated now too: Support for
> Creating, Analyzing, Updating and Fetching data from RRDs are basically
> present, though the interface isn't fully implemented yet.
> 
> As with the preview yesterday, any feedback is appreciated. Suggestions
> and bugreports welcome.
> 
> Regards,
> BenBE.
> 
> P.S.: @Tobi: If you like you can add the extension as a contribution for
> PHP5 or use it to update the outdated version in the SVN. The wrapper
> shouldn't go there yet though as it isn't in a shape for this ATM.
> Comments on its interface welcome though.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> rrd-developers mailing list
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers



More information about the rrd-developers mailing list