diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:26 +0900 |
| commit | 53f1fb395f33e0fb8db9aebd09ea9082f650f9f1 (patch) | |
| tree | f9e8bf0e9d4b1e98cce383574fb6a13b684fff08 /crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs | |
| parent | 212f5cd75b1403ee75ffa44d7ebdb181174340c0 (diff) | |
| download | php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.gz php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.zst php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.zip | |
refactor: add linter
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs b/crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs index 795bb64..aff2a54 100644 --- a/crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs +++ b/crates/shirabe-external-packages/src/symfony/process/pipes/unix_pipes.rs @@ -1,11 +1,10 @@ //! ref: composer/vendor/symfony/process/Pipes/UnixPipes.php -use indexmap::IndexMap; -use shirabe_php_shim::{self as php, Descriptor, PhpMixed, PhpResource}; - use crate::symfony::process::pipes::abstract_pipes::AbstractPipes; use crate::symfony::process::pipes::pipes_interface::{CHUNK_SIZE, PipesInterface}; use crate::symfony::process::process::Process; +use indexmap::IndexMap; +use shirabe_php_shim::{Descriptor, PhpMixed, PhpResource}; /// UnixPipes implementation uses unix pipes as handles. #[derive(Debug)] @@ -44,7 +43,8 @@ fn descriptor(items: &[&str]) -> Descriptor { impl PipesInterface for UnixPipes { fn get_descriptors(&mut self) -> Vec<Descriptor> { if !self.have_read_support { - let nullstream = php::fopen("/dev/null", "c").expect("fopen('/dev/null') failed"); + let nullstream = + shirabe_php_shim::fopen("/dev/null", "c").expect("fopen('/dev/null') failed"); return vec![ descriptor(&["pipe", "r"]), Descriptor::Resource(nullstream.clone()), @@ -100,7 +100,7 @@ impl PipesInterface for UnixPipes { // let's have a look if something changed in streams if (!r_sel.is_empty() || w.is_some()) - && php::stream_select( + && shirabe_php_shim::stream_select( &mut r_sel, &mut w_sel, &mut e_sel, @@ -125,7 +125,7 @@ impl PipesInterface for UnixPipes { for (fd, pipe) in &r { let mut data = String::new(); loop { - let chunk = php::fread(pipe, CHUNK_SIZE).unwrap_or_default(); + let chunk = shirabe_php_shim::fread(pipe, CHUNK_SIZE).unwrap_or_default(); let len = chunk.len() as i64; data.push_str(&chunk); if !(len > 0 && (close || len >= CHUNK_SIZE)) { @@ -137,8 +137,8 @@ impl PipesInterface for UnixPipes { read.insert(*fd, data); } - if close && php::feof(pipe) { - php::fclose(pipe); + if close && shirabe_php_shim::feof(pipe) { + shirabe_php_shim::fclose(pipe); self.inner.pipes.shift_remove(fd); } } |
