X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fshell%2FShell.php;h=467e4ef9a9dc67b0ae050a4c6b0d840dd5c4ac68;hb=286a29ad36463a49d46c7a55db57886464a4dfa8;hp=ee9f1ebbf724bb65781f26aa72ad9ce8a039d259;hpb=18a6b556b3c595bd0ced99316280094e77ab4a7e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/shell/Shell.php b/includes/shell/Shell.php index ee9f1ebbf7..467e4ef9a9 100644 --- a/includes/shell/Shell.php +++ b/includes/shell/Shell.php @@ -110,6 +110,7 @@ class Shell { /** * Returns a new instance of Command class * + * @note You should check Shell::isDisabled() before calling this * @param string|string[] ...$commands 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'" @@ -223,6 +224,7 @@ class Shell { * Note that $parameters should be a flat array and an option with an argument * should consist of two consecutive items in the array (do not use "--option value"). * + * @note You should check Shell::isDisabled() before calling this * @param string $script MediaWiki CLI script with full path * @param string[] $parameters Arguments and options to the script * @param array $options Associative array of options: @@ -235,7 +237,7 @@ class Shell { // Give site config file a chance to run the script in a wrapper. // The caller may likely want to call wfBasename() on $script. Hooks::run( 'wfShellWikiCmd', [ &$script, &$parameters, &$options ] ); - $cmd = isset( $options['php'] ) ? [ $options['php'] ] : [ $wgPhpCli ]; + $cmd = [ $options['php'] ?? $wgPhpCli ]; if ( isset( $options['wrapper'] ) ) { $cmd[] = $options['wrapper']; }