aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/stream.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-25 16:27:53 +0900
committernsfisis <nsfisis@gmail.com>2026-06-26 00:20:05 +0900
commit3a0d9340810a8808d963135a884f50d08442ac67 (patch)
tree9fbed3350a23c791f52e37209095e0db41962c87 /crates/shirabe-php-shim/src/stream.rs
parent46ac7242d526e13707dc140b7244e0fadf2219b9 (diff)
downloadphp-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.tar.gz
php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.tar.zst
php-shirabe-3a0d9340810a8808d963135a884f50d08442ac67.zip
test: port 59 autoload/vcs/installer/util/command tests; fix output capture
Port autoload_generator (24), bitbucket (14), suggested_packages (11), git_driver (6), archive_manager (3), and a bump command test. Fix the ApplicationTester output-capture root cause (php://memory streams must be readable regardless of fopen mode). Implement posix_getuid/geteuid, the PCRE 'A' anchored modifier, php_strip_whitespace, stream_get_wrappers, is_callable scalars; fix preg_quote angle-bracket escaping and class-map parser regexes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/stream.rs')
-rw-r--r--crates/shirabe-php-shim/src/stream.rs25
1 files changed, 22 insertions, 3 deletions
diff --git a/crates/shirabe-php-shim/src/stream.rs b/crates/shirabe-php-shim/src/stream.rs
index f5582a7..a8ccbe5 100644
--- a/crates/shirabe-php-shim/src/stream.rs
+++ b/crates/shirabe-php-shim/src/stream.rs
@@ -112,9 +112,28 @@ pub fn stream_isatty(stream: PhpResource) -> bool {
}
pub fn stream_get_wrappers() -> Vec<String> {
- // TODO(phase-d): the registered wrapper set depends on compiled-in extensions and runtime
- // `stream_wrapper_register` calls; neither is modeled, so a fixed list would be inaccurate.
- todo!()
+ // The full registered set depends on compiled-in extensions and runtime
+ // `stream_wrapper_register` calls, which are not modeled. We return the wrappers always
+ // registered by a stock PHP CLI build (the environment Composer's tests assume): the core
+ // `php`/`file`/`glob`/`data` wrappers, the always-present `phar` wrapper, plus the
+ // `compress.*`/`http`/`ftp` family. Consumers only use this to recognise `wrapper://` prefixes.
+ [
+ "https",
+ "ftps",
+ "compress.zlib",
+ "compress.bzip2",
+ "php",
+ "file",
+ "glob",
+ "data",
+ "http",
+ "ftp",
+ "phar",
+ "zip",
+ ]
+ .iter()
+ .map(|s| s.to_string())
+ .collect()
}
/// PHP `stream_copy_to_stream()`: copy the remaining bytes of `source` into `dest`, returning the