projects
/
php-utility-classes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
579a80e
)
if eval returns nothing, leave array empty; in that case, don't update
author
robert
<robert>
Fri, 13 May 2005 19:40:26 +0000
(19:40 +0000)
committer
robert
<robert>
Fri, 13 May 2005 19:40:26 +0000
(19:40 +0000)
include/classes/rrdstat.php-class
patch
|
blob
|
blame
|
history
diff --git
a/include/classes/rrdstat.php-class
b/include/classes/rrdstat.php-class
index 6eed1bf259c75360e3aab44cac1ed2cfc3a78df0..15cca53b77b2b86af2e9668862e19b6a9eaef7a9 100644
(file)
--- a/
include/classes/rrdstat.php-class
+++ b/
include/classes/rrdstat.php-class
@@
-154,7
+154,8
@@
class rrdstat {
if (!is_null($evalcode)) {
ob_start();
eval($evalcode);
if (!is_null($evalcode)) {
ob_start();
eval($evalcode);
- $upvals = explode("\n", ob_get_contents());
+ $ret = ob_get_contents();
+ if (strlen($ret)) { $upvals = explode("\n", $ret); }
ob_end_clean();
}
$walkfunc = create_function('&$val,$key', '$val = is_numeric($val)?$val:"U";');
ob_end_clean();
}
$walkfunc = create_function('&$val,$key', '$val = is_numeric($val)?$val:"U";');
@@
-195,8
+196,11
@@
class rrdstat {
$upvals[] = is_null($val)?'U':$val;
}
}
$upvals[] = is_null($val)?'U':$val;
}
}
- $update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals);
- $return = `$update_cmd 2>&1`;
+ $return = null;
+ if (count($upvals)) {
+ $update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals);
+ $return = `$update_cmd 2>&1`;
+ }
if (strpos($return, 'ERROR') !== false) {
trigger_error($this->rrd_file.' - rrd update error: '.$return, E_USER_WARNING);
if (strpos($return, 'ERROR') !== false) {
trigger_error($this->rrd_file.' - rrd update error: '.$return, E_USER_WARNING);