Use Config helper (#10339)

remove usage of global variable
This commit is contained in:
Tony Murray
2019-06-23 00:29:12 -05:00
committed by GitHub
parent 342acf50f1
commit f3ba8947f7
367 changed files with 1589 additions and 1857 deletions

View File

@@ -31,11 +31,7 @@ foreach ($components as $id => $array) {
if (rrdtool_check_rrd_exists($rrd_filename)) {
// Grab a color from the array.
if (isset($config['graph_colours']['mixed'][$count])) {
$color = $config['graph_colours']['mixed'][$count];
} else {
$color = $config['graph_colours']['oranges'][$count-7];
}
$color = \LibreNMS\Config::get("graph_colours.mixed.$count", \LibreNMS\Config::get('graph_colours.oranges.' . ($count - 7)));
$rrd_additions .= " DEF:DS" . $count . "=" . $rrd_filename . ":delay:AVERAGE ";
$rrd_additions .= " LINE1.25:DS" . $count . "#" . $color . ":'" . str_pad(substr($array['peer'], 0, 15), 15) . "'" . $stack;