WP_CLI\Utils
proc_open_compat()
Works around bug in PHP, and also deals with *nix-like ENV_VAR=blah cmd environment variable prefixes.
Хуков нет.
Возвращает
resource
. Command stripped of any environment variable settings.
Использование
proc_open_compat( $cmd, $descriptorspec, $pipes, $cwd, $env, $other_options );
- $cmd(строка) (обязательный)
- Command to execute.
- $descriptorspec(массив) (обязательный)
- Indexed array of descriptor numbers and their values.
- $pipes (обязательный) (передается по ссылке — &)
- -
- $cwd(строка)
- Initial working directory for the command.
По умолчанию: null - $env(массив)
- Array of environment variables.
По умолчанию: null - $other_options(массив)
- Array of additional options (Windows only).
По умолчанию: null
Код proc_open_compat() proc open compat WP-CLI 2.7.0-alpha
function proc_open_compat( $cmd, $descriptorspec, &$pipes, $cwd = null, $env = null, $other_options = null ) { if ( is_windows() ) { // Need to encompass the whole command in double quotes - PHP bug https://bugs.php.net/bug.php?id=49139 $cmd = '"' . _proc_open_compat_win_env( $cmd, $env ) . '"'; } return proc_open( $cmd, $descriptorspec, $pipes, $cwd, $env, $other_options ); }