X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fshell%2FCommand.php;h=1936d000fc42cb2dbd115479b8397fd510282dad;hp=1154e05886de77ef821233ba3fb591faa2959c2a;hb=daf15e14ab481e9b8811bc825bb448df5ec80421;hpb=7cd7c534f7c86fff63bbd372dc081816df7d65ca diff --git a/includes/shell/Command.php b/includes/shell/Command.php index 1154e05886..1936d000fc 100644 --- a/includes/shell/Command.php +++ b/includes/shell/Command.php @@ -433,8 +433,9 @@ class Command { // TODO replace with clear_last_error when requirements are bumped to PHP7 set_error_handler( function () { }, 0 ); - // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged - @trigger_error( '' ); + \Wikimedia\suppressWarnings(); + trigger_error( '' ); + \Wikimedia\restoreWarnings(); restore_error_handler(); $readPipes = array_filter( $pipes, function ( $fd ) use ( $desc ) { @@ -552,4 +553,15 @@ class Command { return new Result( $retval, $buffers[1], $buffers[2] ); } + + /** + * Returns the final command line before environment/limiting, etc are applied. + * Use string conversion only for debugging, don't try to pass this to + * some other execution medium. + * + * @return string + */ + public function __toString() { + return "#Command: {$this->command}"; + } }