mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
Enhance Windows support by updating artifact configuration and improving extraction logic
This commit is contained in:
@@ -148,8 +148,12 @@ abstract class Shell
|
||||
bool $console_output = false,
|
||||
?string $original_command = null,
|
||||
bool $capture_output = false,
|
||||
bool $throw_on_error = true
|
||||
bool $throw_on_error = true,
|
||||
?string $cwd = null
|
||||
): array {
|
||||
if ($cwd !== null) {
|
||||
$cwd = $cwd;
|
||||
}
|
||||
$file_res = null;
|
||||
if ($this->enable_log_file) {
|
||||
// write executed command to the log file using fwrite
|
||||
@@ -160,10 +164,10 @@ abstract class Shell
|
||||
}
|
||||
$descriptors = [
|
||||
0 => ['file', 'php://stdin', 'r'], // stdin
|
||||
1 => ['pipe', 'w'], // stdout
|
||||
2 => ['pipe', 'w'], // stderr
|
||||
1 => PHP_OS_FAMILY === 'Windows' ? ['socket'] : ['pipe', 'w'], // stdout
|
||||
2 => PHP_OS_FAMILY === 'Windows' ? ['socket'] : ['pipe', 'w'], // stderr
|
||||
];
|
||||
$process = proc_open($cmd, $descriptors, $pipes);
|
||||
$process = proc_open($cmd, $descriptors, $pipes, $cwd);
|
||||
|
||||
$output_value = '';
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user