syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@2642 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-10-04 09:10:21 +00:00
parent 9e12148dd3
commit 2dc8b807e9
46 changed files with 94 additions and 95 deletions
+6 -5
View File
@@ -26,9 +26,10 @@ function shorthost($hostname, $len=12)
return ($shorthost); return ($shorthost);
} }
function isCli() { function isCli()
{
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) { if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']))
{
return true; return true;
} else { } else {
return false; return false;
@@ -53,7 +54,6 @@ function print_message($text)
} }
} }
function delete_port($int_id) function delete_port($int_id)
{ {
global $config; global $config;
@@ -62,7 +62,8 @@ function delete_port($int_id)
$interface_tables = array('adjacencies', 'ipaddr', 'ip6adjacencies', 'ip6addr', 'mac_accounting', 'bill_ports', 'pseudowires', 'ports'); $interface_tables = array('adjacencies', 'ipaddr', 'ip6adjacencies', 'ip6addr', 'mac_accounting', 'bill_ports', 'pseudowires', 'ports');
foreach($interface_tables as $table) { foreach ($interface_tables as $table)
{
dbDelete($table, "`interface_id` = ?", array($int_id)); dbDelete($table, "`interface_id` = ?", array($int_id));
} }
+1 -3
View File
@@ -68,7 +68,6 @@ function rrdtool_pipe_open(&$rrd_process, &$rrd_pipes)
function rrdtool_pipe_close(&$rrd_process, &$rrd_pipes) function rrdtool_pipe_close(&$rrd_process, &$rrd_pipes)
{ {
if ($debug) if ($debug)
{ {
echo stream_get_contents($rrd_pipes[1]); echo stream_get_contents($rrd_pipes[1]);
@@ -100,7 +99,6 @@ function rrdtool_pipe_close(&$rrd_process, &$rrd_pipes)
function rrdtool_graph($graph_file, $options) function rrdtool_graph($graph_file, $options)
{ {
global $config, $debug; global $config, $debug;
rrdtool_pipe_open($rrd_process, $rrd_pipes); rrdtool_pipe_open($rrd_process, $rrd_pipes);
@@ -178,8 +176,8 @@ function rrdtool($command, $filename, $options)
function rrdtool_create($filename, $options) function rrdtool_create($filename, $options)
{ {
global $config, $debug;
global $config; global $debug;
$command = $config['rrdtool'] . " create $filename $options"; $command = $config['rrdtool'] . " create $filename $options";
if ($debug) { echo($command."\n"); } if ($debug) { echo($command."\n"); }