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:
ebe0332
)
better assembling of used config based on defaults
author
robert
<robert>
Mon, 9 May 2005 19:24:28 +0000
(19:24 +0000)
committer
robert
<robert>
Mon, 9 May 2005 19:24:28 +0000
(19:24 +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 52ecfc1bd927a960744d08800cb70f5680495b7f..3d7b84d11e5ec510a644756dca435ab89aa5b66a 100644
(file)
--- a/
include/classes/rrdstat.php-class
+++ b/
include/classes/rrdstat.php-class
@@
-48,7
+48,11
@@
class rrdstat {
if (!is_null($conf_id)) {
$iinfo = isset($complete_conf[$conf_id])?$complete_conf[$conf_id]:array();
if (!is_null($conf_id)) {
$iinfo = isset($complete_conf[$conf_id])?$complete_conf[$conf_id]:array();
- if (isset($complete_conf['*'])) { $iinfo = array_merge_recursive($complete_conf['*'], $iinfo); }
+ if (isset($complete_conf['*'])) {
+ $iinfo = (array)$iinfo + (array)$complete_conf['*'];
+ if (isset($complete_conf['*']['graph'])) { $iinfo['graph'] = (array)$iinfo['graph'] + (array)$complete_conf['*']['graph']; }
+ if (isset($complete_conf['*']['page'])) { $iinfo['page'] = (array)$iinfo['page'] + (array)$complete_conf['*']['page']; }
+ }
}
else {
$iinfo = $complete_conf;
}
else {
$iinfo = $complete_conf;
@@
-234,15
+238,11
@@
class rrdstat {
if (!in_array($this->status, array('ok','readonly'))) { trigger_error('Error: rrd status is '.$this->status, E_USER_WARNING); return false; }
// assemble configuration
if (!in_array($this->status, array('ok','readonly'))) { trigger_error('Error: rrd status is '.$this->status, E_USER_WARNING); return false; }
// assemble configuration
- $gconf =
$this->config_graph
;
+ $gconf =
(array)$extra
;
if (!is_null($sub) && is_array($this->config_raw['graph.'.$sub])) {
if (!is_null($sub) && is_array($this->config_raw['graph.'.$sub])) {
- if (is_array($gconf)) { $gconf = array_merge($gconf, $this->config_raw['graph.'.$sub]); }
- else { $gconf = $this->config_raw['graph.'.$sub]; }
- }
- if (is_array($extra)) {
- if (is_array($gconf)) { $gconf = array_merge($gconf, $extra); }
- else { $gconf = $extra; }
+ $gconf = $gconf + $this->config_raw['graph.'.$sub];
}
}
+ $gconf = $gconf + (array)$this->config_graph;
if (isset($gconf['format']) && ($gconf['format'] == 'SVG')) {
$format = $gconf['format']; $fmt_ext = '.svg';
if (isset($gconf['format']) && ($gconf['format'] == 'SVG')) {
$format = $gconf['format']; $fmt_ext = '.svg';
@@
-456,15
+456,11
@@
class rrdstat {
$basename = str_replace('.rrd', '', $this->rrd_file);
// assemble configuration
$basename = str_replace('.rrd', '', $this->rrd_file);
// assemble configuration
- $pconf =
$this->config_page
;
+ $pconf =
(array)$page_extras
;
if (!is_null($sub) && is_array($this->config_raw['page.'.$sub])) {
if (!is_null($sub) && is_array($this->config_raw['page.'.$sub])) {
- if (is_array($pconf)) { $gconf = array_merge($pconf, $this->config_raw['page.'.$sub]); }
- else { $pconf = $this->config_raw['page.'.$sub]; }
- }
- if (is_array($page_extras)) {
- if (is_array($pconf)) { $pconf = array_merge($pconf, $page_extras); }
- else { $pconf = $page_extras; }
+ $pconf = $pconf + $this->config_raw['page.'.$sub];
}
}
+ $pconf = $pconf + (array)$this->config_page;
$ptitle = isset($pconf['title_page'])?$pconf['title_page']:$basename.' - RRD statistics';
$gtitle = array();
$ptitle = isset($pconf['title_page'])?$pconf['title_page']:$basename.' - RRD statistics';
$gtitle = array();