handbook/internal-api/wp-cli-utils-proc-open-compat.md
github-actions[bot] ff2a543077 Regenerate handbook
2026-07-21 08:35:57 +00:00

2.7 KiB

WP_CLI\Utils\proc_open_compat()

Windows compatible proc_open(). Works around bug in PHP, and also deals with *nix-like ENV_VAR=blah cmd environment variable prefixes.


Usage

WP_CLI\Utils\proc_open_compat( $cmd, $descriptorspec, $pipes, $cwd = null, $env = null, $other_options = null )
$cmd (string) Command to execute.
list<string>|resource> (array<int,) $descriptorspec Indexed array of descriptor numbers and their values.
resource> (array<int,) &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created.
$cwd (string) Initial working directory for the command.
string> (array<string,) $env Array of environment variables.
bool>|null (array<string,) $other_options Array of additional options (Windows only).
array<int, (@param-out) resource> $pipes
@return (resource|false) stripped of any environment variable settings, or false on failure.

Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.