From 381f526d66874703b877a315e108a6d4c82cb4a8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 5 Apr 2019 15:18:20 -0400 Subject: [PATCH] spacing --- web/includes/control_functions.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/web/includes/control_functions.php b/web/includes/control_functions.php index bea235668..77240df49 100644 --- a/web/includes/control_functions.php +++ b/web/includes/control_functions.php @@ -735,29 +735,29 @@ function buildControlCommand( $monitor ) { return( $ctrlCommand ); } -function sendControlCommand($mid,$command) { +function sendControlCommand($mid, $command) { // Either connects to running zmcontrol.pl or runs zmcontrol.pl to send the command. - $socket = socket_create( AF_UNIX, SOCK_STREAM, 0 ); + $socket = socket_create(AF_UNIX, SOCK_STREAM, 0); if ( $socket < 0 ) { - Fatal( 'socket_create() failed: '.socket_strerror($socket) ); + Fatal('socket_create() failed: '.socket_strerror($socket)); } $sockFile = ZM_PATH_SOCKS.'/zmcontrol-'.$mid.'.sock'; - if ( @socket_connect( $socket, $sockFile ) ) { + if ( @socket_connect($socket, $sockFile) ) { $options = array(); - foreach ( explode( ' ', $command ) as $option ) { - if ( preg_match( '/--([^=]+)(?:=(.+))?/', $option, $matches ) ) { + foreach ( explode(' ', $command) as $option ) { + if ( preg_match('/--([^=]+)(?:=(.+))?/', $option, $matches) ) { $options[$matches[1]] = $matches[2]?$matches[2]:1; } } - $optionString = jsonEncode( $options ); - if ( !socket_write( $socket, $optionString ) ) { - Fatal( "Can't write to control socket: ".socket_strerror(socket_last_error($socket)) ); + $optionString = jsonEncode($options); + if ( !socket_write($socket, $optionString) ) { + Fatal("Can't write to control socket: ".socket_strerror(socket_last_error($socket))); } - socket_close( $socket ); + socket_close($socket); } else if ( $command != 'quit' ) { $command .= ' --id='.$mid; // Can't connect so use script - $ctrlOutput = exec( escapeshellcmd( $command ) ); + $ctrlOutput = exec(escapeshellcmd($command)); } -} // end function sendControlCommand( $mid, $command ) +} // end function sendControlCommand($mid, $command)