X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fshell%2FShell.php;h=a660a22314537eb2c83da19afc16cb8d46346c1f;hp=c293ff2110ebc069d387dee1ad169c5edbeaa152;hb=d94c0484302f80cf30ef107b2fdb6b84293e1937;hpb=af09cc10883257b872308729b04242b0fe8e2fb8 diff --git a/includes/shell/Shell.php b/includes/shell/Shell.php index c293ff2110..a660a22314 100644 --- a/includes/shell/Shell.php +++ b/includes/shell/Shell.php @@ -22,6 +22,8 @@ namespace MediaWiki\Shell; +use MediaWiki\MediaWikiServices; + /** * Executes shell commands * @@ -35,14 +37,15 @@ namespace MediaWiki\Shell; * * ... = $result->getExitCode(); * ... = $result->getStdout(); + * ... = $result->getStderr(); */ class Shell { /** - * Returns a new instance of this class + * Returns a new instance of Command class * - * @param string|string[] $command If string, a properly shell-escaped command line, - * or an array of unescaped arguments, in which case each value will be escaped + * @param string|string[] $command String or array of strings representing the command to + * be executed, each value will be escaped. * Example: [ 'convert', '-font', 'font name' ] would produce "'convert' '-font' 'font name'" * @return Command */ @@ -53,7 +56,10 @@ class Shell { // treat it as a list of arguments $args = reset( $args ); } - $command = new Command(); + $command = MediaWikiServices::getInstance() + ->getShellCommandFactory() + ->create(); + return $command->params( $args ); }