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:
461e89f
)
don't error out if the graph doesn't exist but can be created
author
Robert Kaiser
<kairo@kairo.at>
Sun, 19 Jul 2020 15:09:06 +0000
(17:09 +0200)
committer
Robert Kaiser
<kairo@kairo.at>
Sun, 19 Jul 2020 15:09:06 +0000
(17:09 +0200)
classes/rrdstat.php-class
patch
|
blob
|
blame
|
history
diff --git
a/classes/rrdstat.php-class
b/classes/rrdstat.php-class
index 9226d564f5f70c2059b340bfdeca81ea39b0e509..0a71f13da11858fc9456fc7e44ed759fd891d90e 100644
(file)
--- a/
classes/rrdstat.php-class
+++ b/
classes/rrdstat.php-class
@@
-760,7
+760,8
@@
class rrdstat {
}
$graph_cmd = $this->rrdtool_bin.' graph '.str_replace('*', '\*', $fname.$gOpts.$gDefs.$gGraphs.$addSpecial);
- if (!is_writable($fname)) {
+ if ((file_exists($fname) && !is_writable($fname)) ||
+ (!file_exists($fname) && !is_writable(dirname($fname)))) {
trigger_error($this->rrd_file.' - graph file not writable: '.$fname, E_USER_WARNING);
return 'command:'.$graph_cmd."\n\n".'unwritable file: '.$fname;
}