From c5fc34a106a706ac12925c4df273a926811d260b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 24 Jun 2026 03:09:17 +0900 Subject: feat(process): redesign proc_* on PhpResource process handles proc_open/proc_close/proc_get_status/proc_terminate represented the process handle as a PhpMixed, which cannot hold a live child process or its pipes, so they were stubs or todo!(). Model the handle as a new PhpResource::Process variant and child pipes as a StreamBacking::Pipe, with a native Descriptor enum for descriptorspec; proc_open now returns io::Result and fills pipes as IndexMap. Rewire the Symfony Process pipes and the Console terminal/cursor onto the new types, removing the "PhpMixed cannot carry a PhpResource" todo!()s. The remaining todo!()s are genuine syscall leaves (proc_terminate signal delivery, stream_select, stream_set_blocking, posix_kill, pty, fd>=3) left unimplemented since no syscall crate is introduced. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/process/pipes/windows_pipes.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/process/pipes/windows_pipes.rs') diff --git a/crates/shirabe-external-packages/src/symfony/process/pipes/windows_pipes.rs b/crates/shirabe-external-packages/src/symfony/process/pipes/windows_pipes.rs index 7602e7d..a31f184 100644 --- a/crates/shirabe-external-packages/src/symfony/process/pipes/windows_pipes.rs +++ b/crates/shirabe-external-packages/src/symfony/process/pipes/windows_pipes.rs @@ -1,7 +1,7 @@ //! ref: composer/vendor/symfony/process/Pipes/WindowsPipes.php use indexmap::IndexMap; -use shirabe_php_shim::PhpMixed; +use shirabe_php_shim::{Descriptor, PhpMixed, PhpResource}; use crate::symfony::process::pipes::abstract_pipes::AbstractPipes; use crate::symfony::process::pipes::pipes_interface::PipesInterface; @@ -11,8 +11,8 @@ use crate::symfony::process::pipes::pipes_interface::PipesInterface; pub struct WindowsPipes { inner: AbstractPipes, files: IndexMap, - file_handles: IndexMap, - lock_handles: IndexMap, + file_handles: IndexMap, + lock_handles: IndexMap, read_bytes: IndexMap, have_read_support: bool, } @@ -25,7 +25,7 @@ impl WindowsPipes { } impl PipesInterface for WindowsPipes { - fn get_descriptors(&mut self) -> Vec { + fn get_descriptors(&mut self) -> Vec { let _ = ( &self.files, &self.file_handles, @@ -48,7 +48,7 @@ impl PipesInterface for WindowsPipes { } fn are_open(&self) -> bool { - shirabe_php_shim::php_truthy(&self.inner.pipes) && !self.file_handles.is_empty() + !self.inner.pipes.is_empty() && !self.file_handles.is_empty() } fn close(&mut self) { @@ -56,11 +56,11 @@ impl PipesInterface for WindowsPipes { todo!() } - fn pipes(&self) -> &PhpMixed { + fn pipes(&self) -> &IndexMap { &self.inner.pipes } - fn pipes_mut(&mut self) -> &mut PhpMixed { + fn pipes_mut(&mut self) -> &mut IndexMap { &mut self.inner.pipes } } -- cgit v1.3.1