diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-25 17:14:07 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-26 00:20:05 +0900 |
| commit | 0dd510dbc3a5b6e888abcc104ae8c4a4eeb1e42b (patch) | |
| tree | 8b6e7663c82bd7c4bbe91f4594940aa780376d77 /crates/shirabe-external-packages | |
| parent | 6c137a28151f5ef05c9e22d3232e9ba7b81f6abe (diff) | |
| download | php-shirabe-0dd510dbc3a5b6e888abcc104ae8c4a4eeb1e42b.tar.gz php-shirabe-0dd510dbc3a5b6e888abcc104ae8c4a4eeb1e42b.tar.zst php-shirabe-0dd510dbc3a5b6e888abcc104ae8c4a4eeb1e42b.zip | |
feat(shim): implement stream_select/stream_set_blocking via libc
Add fcntl/select extern "C" declarations and a PhpResource::raw_fd seam so the
symfony Process pipe loop can read a live child's stdout/stderr. Fix fread on a
non-blocking fd (WouldBlock -> "") and the Process null-cwd default. Real
subprocess output capture now works; un-ignore the process_executor tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/process/process.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/process/process.rs b/crates/shirabe-external-packages/src/symfony/process/process.rs index 3550f09..1b58972 100644 --- a/crates/shirabe-external-packages/src/symfony/process/process.rs +++ b/crates/shirabe-external-packages/src/symfony/process/process.rs @@ -222,7 +222,11 @@ impl Process { this.cwd = cwd; // on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started - if this.cwd.is_none() && php::DIRECTORY_SEPARATOR == "\\" { + // PHP: null === $this->cwd && (\defined('ZEND_THREAD_SAFE') || '\\' === \DIRECTORY_SEPARATOR) + // `\defined('ZEND_THREAD_SAFE')` is unconditionally true in modern PHP (the constant always + // exists; its value merely reflects the NTS/ZTS build), so the disjunction is always true and + // the cwd is defaulted to getcwd() whenever it was null. + if this.cwd.is_none() { this.cwd = php::getcwd(); } if let Some(env) = env { |
