From: Fomafix Date: Thu, 12 Oct 2017 10:51:05 +0000 (+0200) Subject: shell: Deduplicate code in Command.php by combining else paths X-Git-Tag: 1.31.0-rc.0~1795^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=af72813a12b537a58dc3b189ff55225400a5c685;p=lhc%2Fweb%2Fwiklou.git shell: Deduplicate code in Command.php by combining else paths Also reduce indenting. Change-Id: I33f83786c38bba0919372df0d5cdfa806d4361fc --- diff --git a/includes/shell/Command.php b/includes/shell/Command.php index fb2d787a41..d5a1bb3f6c 100644 --- a/includes/shell/Command.php +++ b/includes/shell/Command.php @@ -245,10 +245,9 @@ class Command { "MW_USE_LOG_PIPE=yes" ); $useLogPipe = true; - } elseif ( $this->useStderr ) { - $cmd .= ' 2>&1'; } - } elseif ( $this->useStderr ) { + } + if ( !$useLogPipe && $this->useStderr ) { $cmd .= ' 2>&1'; } wfDebug( __METHOD__ . ": $cmd\n" ); @@ -259,7 +258,7 @@ class Command { // input. See T129506. if ( strlen( $cmd ) > SHELL_MAX_ARG_STRLEN ) { throw new Exception( __METHOD__ . - '(): total length of $cmd must not exceed SHELL_MAX_ARG_STRLEN' ); + '(): total length of $cmd must not exceed SHELL_MAX_ARG_STRLEN' ); } $desc = [