8000 Fix group alias execution on Windows by passing $env to proc_open_compat by Copilot · Pull Request #6221 · wp-cli/wp-cli · GitHub
[go: up one dir, main page]

Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion php/WP_CLI/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,8 @@ static function ( string $arg ): string {
$escaped_alias = escapeshellarg( $alias );
$full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$escaped_alias} {$args}{$assoc_args}{$runtime_config}";
$pipes = [];
$proc = Utils\proc_open_compat( $full_command, [ STDIN, STDOUT, STDERR ], $pipes );
$env = null;
$proc = Utils\proc_open_compat( $full_command, [ STDIN, STDOUT, STDERR ], $pipes, null, $env );
Comment on lines +1333 to +1334
Copy link
Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing $env initialized to null into Utils\proc_open_compat() appears to be a no-op: proc_open_compat() already calls _proc_open_compat_win_env( $cmd, $env ) on Windows even when $env is omitted/defaults to null (php/utils.php:1831-1837). Also, the sequential branch below still uses the 3-arg call, so if the PR description’s root cause is accurate, group aliases would still fail when WP_CLI_ALIAS_GROUPS_PARALLEL is not set. Please either adjust the real root cause (e.g., command/env construction) or apply an effective fix consistently to both branches (and/or proc_open_compat() itself).

Suggested change
$env = null;
$proc = Utils\proc_open_compat( $full_command, [ STDIN, STDOUT, STDERR ], $pipes, null, $env );
$proc = Utils\proc_open_compat( $full_command, [ STDIN, STDOUT, STDERR ], $pipes );

Copilot uses AI. Check for mistakes.

if ( $proc ) {
$procs[] = $proc;
Expand Down
0