diff -up rrd-0.10.0/rrd.c.features rrd-0.10.0/rrd.c --- rrd-0.10.0/rrd.c.features 2011-03-02 12:55:17.000000000 +0100 +++ rrd-0.10.0/rrd.c 2011-03-07 19:21:51.543122688 +0100 @@ -33,6 +33,17 @@ #include "rrd_update.h" #include "rrd_info.h" +/* {{{ proto string rrd_strversion() +Get the rrdtool library version +*/ +PHP_FUNCTION(rrd_strversion) +{ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + return; + } + RETVAL_STRING(rrd_strversion(), 1); +} + /* {{{ proto string rrd_error() Get the error message set by the last rrd tool function call, this function clear error buffer also. @@ -535,6 +546,7 @@ static function_entry rrd_functions[] = PHP_FE(rrd_create, arginfo_rrd_create) PHP_FE(rrd_graph, arginfo_rrd_graph) PHP_FE(rrd_error, NULL) + PHP_FE(rrd_strversion, NULL) PHP_FE(rrd_fetch, arginfo_rrd_fetch) PHP_FE(rrd_first, arginfo_rrd_first) PHP_FE(rrd_info, arginfo_rrd_info) @@ -567,6 +579,7 @@ static PHP_MINFO_FUNCTION(rrd) php_info_print_table_start(); php_info_print_table_header(2, "rrd tool module", "enabled"); php_info_print_table_row(2, "rrd tool module version", PHP_RRD_VERSION); + php_info_print_table_row(2, "rrdtool library version", rrd_strversion()); php_info_print_table_end(); } /* }}} */ diff -up rrd-0.10.0/tests/rrd_019.phpt.features rrd-0.10.0/tests/rrd_019.phpt --- rrd-0.10.0/tests/rrd_019.phpt.features 2011-03-07 19:29:07.381420065 +0100 +++ rrd-0.10.0/tests/rrd_019.phpt 2011-03-07 19:33:19.003867018 +0100 @@ -1,7 +1,11 @@ --TEST-- RRDGraph saveVerbose full export test --SKIPIF-- - += 1.4.x'; +} +?> --FILE-- =')) { + print 'skip - test only applies to rrdtool 1.3.x'; +} +?> +--FILE-- +setOptions(array( + "--start" => "920804400", + "--end" => 920808000, + "--vertical-label" => "m/s", + "DEF:myspeed=$rrdFile:speed:AVERAGE", + "CDEF:realspeed=myspeed,1000,*", + "LINE2:realspeed#FF0000" +)); +$output = $graphObj->saveVerbose(); +$imgData = $output["image"]; unset($output["image"]); +//output without img data +var_dump($output); +//detection of correct PNG header +var_dump(substr($imgData, 0, 8) == "\x89PNG\x0d\x0a\x1a\x0a"); +?> +--EXPECTF-- +array(10) { + ["graph_left"]=> + int(67) + ["graph_top"]=> + int(22) + ["graph_width"]=> + int(400) + ["graph_height"]=> + int(100) + ["image_width"]=> + int(497) + ["image_height"]=> + int(149) + ["graph_start"]=> + int(920804400) + ["graph_end"]=> + int(920808000) + ["value_min"]=> + float(0) + ["value_max"]=> + float(40) +} +bool(true)