Remove all unneeded if($debug)-statements and replace them with d_echo in the rest of the directories...

This commit is contained in:
Mark Schouten
2015-08-21 16:10:01 +02:00
parent 677a4f3f5f
commit 4792879ce5
10 changed files with 22 additions and 59 deletions
+5 -11
View File
@@ -23,7 +23,7 @@
function rrdtool_pipe_open(&$rrd_process, &$rrd_pipes) {
global $config, $debug;
global $config;
$command = $config['rrdtool'].' -';
@@ -74,12 +74,8 @@ function rrdtool_pipe_open(&$rrd_process, &$rrd_pipes) {
function rrdtool_pipe_close($rrd_process, &$rrd_pipes) {
global $debug;
if ($debug) {
echo stream_get_contents($rrd_pipes[1]);
echo stream_get_contents($rrd_pipes[2]);
}
d_echo(stream_get_contents($rrd_pipes[1]));
d_echo(stream_get_contents($rrd_pipes[2]));
fclose($rrd_pipes[0]);
fclose($rrd_pipes[1]);
@@ -210,7 +206,7 @@ function rrdtool($command, $filename, $options) {
function rrdtool_create($filename, $options) {
global $config, $debug, $console_color;
global $config, $console_color;
if ($config['norrd']) {
print $console_color->convert('[%gRRD Disabled%n] ', false);
@@ -219,9 +215,7 @@ function rrdtool_create($filename, $options) {
$command = $config['rrdtool']." create $filename $options";
}
if ($debug) {
print $console_color->convert('RRD[%g'.$command.'%n] ');
}
d_echo($console_color->convert('RRD[%g'.$command.'%n] '));
return shell_exec($command);