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 (from parent 1:
f21e94d
)
allow update function to feed us 'L' and we replace it with the last recorded value...
author
robert
<robert>
Fri, 20 May 2005 13:53:32 +0000
(13:53 +0000)
committer
robert
<robert>
Fri, 20 May 2005 13:53:32 +0000
(13:53 +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 c0d752019505048f97c0ebe4e80e3118cac1bd18..833820a8e30bf3bee8e91d1bf0fd03cf0b2082dd 100644
(file)
--- a/
include/classes/rrdstat.php-class
+++ b/
include/classes/rrdstat.php-class
@@
-297,7
+297,7
@@
class rrdstat {
if (strlen($ret)) { $upvals = explode("\n", $ret); }
ob_end_clean();
}
if (strlen($ret)) { $upvals = explode("\n", $ret); }
ob_end_clean();
}
- $walkfunc = create_function('&$val,$key', '$val = is_numeric(trim($val))?trim($val):
"U"
;');
+ $walkfunc = create_function('&$val,$key', '$val = is_numeric(trim($val))?trim($val):
((trim($val)=="L")?"L":"U")
;');
array_walk($upvals, $walkfunc);
}
else {
array_walk($upvals, $walkfunc);
}
else {
@@
-337,9
+337,11
@@
class rrdstat {
}
if (in_array('L', $upvals)) {
// for at least one value, we need to set the same as the last recorded value
}
if (in_array('L', $upvals)) {
// for at least one value, we need to set the same as the last recorded value
- $lastvals = $this->fetch();
+ $fvals = $this->fetch();
+ $rowids = array_shift($fvals);
+ $lastvals = array_shift($fvals);
foreach (array_keys($upvals, 'L') as $akey) {
foreach (array_keys($upvals, 'L') as $akey) {
- $upvals[$akey] = $lastvals[$
akey
];
+ $upvals[$akey] = $lastvals[$
rowids[$akey]
];
}
}
$return = null;
}
}
$return = null;
@@
-385,7
+387,7
@@
class rrdstat {
foreach ($rows as $row) {
if (strlen(trim($row))) {
$rvals = preg_split('/\s+/', $row);
foreach ($rows as $row) {
if (strlen(trim($row))) {
$rvals = preg_split('/\s+/', $row);
- $rtime =
array_shift($rvals
);
+ $rtime =
str_replace(':', '', array_shift($rvals)
);
$rv_array = array();
foreach ($rvals as $key=>$rval) {
$rv_array[$fields[$key]] = ($rval=='nan')?null:floatval($rval);
$rv_array = array();
foreach ($rvals as $key=>$rval) {
$rv_array[$fields[$key]] = ($rval=='nan')?null:floatval($rval);