X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=2cde17323617af21de431311d87b11b6cd09339f;hb=a9fb2b3b064c7d573cbed11f6cf3d78996a7f57e;hp=9e7dd8ff16b02a81feb316213983c688ff0895f2;hpb=5eac6d131c2a77d04b019d4c60aa02a4f98c7903;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9e7dd8ff16..2cde173236 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1127,6 +1127,7 @@ function wfLogProfilingData() { if ( isset( $ctx['forwarded_for'] ) || isset( $ctx['client_ip'] ) || isset( $ctx['from'] ) ) { + // @phan-suppress-next-line PhanTypeArraySuspiciousNullable $ctx['proxy'] = $_SERVER['REMOTE_ADDR']; } @@ -2115,6 +2116,7 @@ function wfEscapeShellArg( ...$args ) { * including errors from limit.sh * - profileMethod: By default this function will profile based on the calling * method. Set this to a string for an alternative method to profile from + * @phan-param array{duplicateStderr?:bool,profileMethod?:string} $options * * @return string Collected stdout as a string * @deprecated since 1.30 use class MediaWiki\Shell\Shell @@ -2133,6 +2135,7 @@ function wfShellExec( $cmd, &$retval = null, $environ = [], } $includeStderr = isset( $options['duplicateStderr'] ) && $options['duplicateStderr']; + // @phan-suppress-next-line PhanTypeInvalidDimOffset $profileMethod = $options['profileMethod'] ?? wfGetCaller(); try { @@ -2189,6 +2192,7 @@ function wfShellExecWithStderr( $cmd, &$retval = null, $environ = [], $limits = * @param array $options Associative array of options: * 'php': The path to the php executable * 'wrapper': Path to a PHP wrapper to handle the maintenance script + * @phan-param array{php?:string,wrapper?:string} $options * @return string */ function wfShellWikiCmd( $script, array $parameters = [], array $options = [] ) { @@ -2196,6 +2200,7 @@ function wfShellWikiCmd( $script, array $parameters = [], array $options = [] ) // 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 ] ); + // @phan-suppress-next-line PhanTypeInvalidDimOffset $cmd = [ $options['php'] ?? $wgPhpCli ]; if ( isset( $options['wrapper'] ) ) { $cmd[] = $options['wrapper'];