function execute( $command, $log=null ) {
            $output = array();
            exec( $command, $output, $return_code );
            if ($log) {
                fwrite( $log, "COMMAND: $command \n" );
                $outputs = implode( "\n", $output );
                fwrite( $log, "OUTPUT: $outputs \n" );
                fwrite( $log, "RETURN_CODE: $return_code\n " );
            }
            return $return_code;
        }
function execute( $command, $log=null ) {
            $output = array();
            exec( $command, $output, $return_code );
            if ($log) {
                fwrite( $log, "COMMAND: $command \n" );
                $outputs = implode( "\n", $output );
                fwrite( $log, "OUTPUT: $outputs \n" );
                fwrite( $log, "RETURN_CODE: $return_code\n " );
            }
            return $return_code;
        }
function execute ( $ command , $ log = null ) { $ output = array ( ) ; exec ( $ command , $ output , $ return_code ) ; if ( $ log ) { fwrite ( $ log , "COMMAND: $command \n" ) ; $ outputs = implode ( "\n" , $ output ) ; fwrite ( $ log , "OUTPUT: $outputs \n" ) ; fwrite ( $ log , "RETURN_CODE: $return_code\n " ) ; } return $ return_code ; }
execute an external command, with optional logging
@param string $command command to execute
@param file $log valid open file handle - log info will be written to this file
@return return code from execution of command
execute an external command with optional logging