aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorPim van den Berg2014-03-22 16:25:57 +0100
committerPim van den Berg2014-03-22 16:25:57 +0100
commitdea39449a9e4dad52f1682af680dd9fec9b6517f (patch)
tree3f7f7fcc00997ca6e7117f459d355c9cce92039c /type
parentadd rrdcached flush support (diff)
downloadapt-panopticon_cgp-dea39449a9e4dad52f1682af680dd9fec9b6517f.zip
apt-panopticon_cgp-dea39449a9e4dad52f1682af680dd9fec9b6517f.tar.gz
apt-panopticon_cgp-dea39449a9e4dad52f1682af680dd9fec9b6517f.tar.bz2
apt-panopticon_cgp-dea39449a9e4dad52f1682af680dd9fec9b6517f.tar.xz
type/Default: merge file2identifier function into rrd_files
Diffstat (limited to 'type')
-rw-r--r--type/Default.class.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index c4fa8a9..2cd8560 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -34,7 +34,6 @@ class Type_Default {
34 $this->cache = $config['cache']; 34 $this->cache = $config['cache'];
35 $this->parse_get(); 35 $this->parse_get();
36 $this->rrd_files(); 36 $this->rrd_files();
37 $this->identifiers = $this->file2identifier($this->files);
38 $this->width = GET('x'); 37 $this->width = GET('x');
39 if (empty($this->width)) $this->width = $config['width']; 38 if (empty($this->width)) $this->width = $config['width'];
40 $this->height = GET('y'); 39 $this->height = GET('y');
@@ -143,10 +142,12 @@ class Type_Default {
143 142
144 $this->tinstances[] = $instance; 143 $this->tinstances[] = $instance;
145 $this->files[$instance] = $filename; 144 $this->files[$instance] = $filename;
145 $this->identifiers[$instance] = preg_replace("#^$this->datadir/(.*)\.rrd$#", '$1', $filename);
146 } 146 }
147 147
148 sort($this->tinstances); 148 sort($this->tinstances);
149 ksort($this->files); 149 ksort($this->files);
150 ksort($this->identifiers);
150 } 151 }
151 152
152 function get_filenames() { 153 function get_filenames() {
@@ -166,17 +167,6 @@ class Type_Default {
166 return $files; 167 return $files;
167 } 168 }
168 169
169 function file2identifier($files) {
170 foreach($files as $key => $file) {
171 if (is_file($file)) {
172 $files[$key] = preg_replace("#^$this->datadir/#u", '', $files[$key]);
173 $files[$key] = preg_replace('#\.rrd$#', '', $files[$key]);
174 }
175 }
176
177 return $files;
178 }
179
180 function rrd_graph($debug = false) { 170 function rrd_graph($debug = false) {
181 if (!$this->colors) 171 if (!$this->colors)
182 $this->rainbow_colors(); 172 $this->rainbow_colors();