Merge pull request #1715 from laf/rrdoptions

Updated rrdtool_update() to use new array format
This commit is contained in:
Daniel Preussker
2015-09-22 12:15:59 +00:00
65 changed files with 592 additions and 271 deletions
+9 -6
View File
@@ -234,20 +234,23 @@ function rrdtool_create($filename, $options) {
function rrdtool_update($filename, $options) {
$values = array();
// Do some sanitisation on the data if passed as an array.
if (is_array($options)) {
$values[] = 'N';
foreach ($options as $value) {
if (!is_numeric($value)) {
$value = U;
foreach ($options as $k => $v) {
if (!is_numeric($v)) {
$v = U;
}
$values[] = $value;
$values[] = $v;
}
$options = implode(':', $values);
return rrdtool('update', $filename, $options);
}
else {
return 'Bad options passed to rrdtool_update';
}
return rrdtool('update', $filename, $options);
}