aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/lib.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-24 00:47:20 +0900
committernsfisis <nsfisis@gmail.com>2026-06-24 00:47:53 +0900
commit340164c64e90d44b1bdf620b514166db1f76cc98 (patch)
tree86195fe5ff8582b64e0324e9f40619e36c04948f /crates/shirabe-php-shim/src/lib.rs
parent8fe3390d064303b86133a1d2983144a4818a7121 (diff)
downloadphp-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.gz
php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.zst
php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.zip
test: port more unimplemented tests
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/lib.rs')
-rw-r--r--crates/shirabe-php-shim/src/lib.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs
index 267c3b7..8eb8f2f 100644
--- a/crates/shirabe-php-shim/src/lib.rs
+++ b/crates/shirabe-php-shim/src/lib.rs
@@ -383,16 +383,28 @@ pub struct StreamState {
/// only reports true after a read has hit the end; cleared by a seek.
pub(crate) eof: bool,
pub(crate) closed: bool,
+ /// The mode string passed to `fopen`, reported back by `stream_get_meta_data`.
+ pub(crate) mode: String,
+ /// The path/URI the stream was opened from, reported back by `stream_get_meta_data`.
+ pub(crate) uri: String,
}
impl StreamState {
- pub(crate) fn new(backing: StreamBacking, readable: bool, writable: bool) -> PhpResource {
+ pub(crate) fn new(
+ backing: StreamBacking,
+ readable: bool,
+ writable: bool,
+ mode: String,
+ uri: String,
+ ) -> PhpResource {
PhpResource::Stream(std::rc::Rc::new(std::cell::RefCell::new(StreamState {
backing,
readable,
writable,
eof: false,
closed: false,
+ mode,
+ uri,
})))
}
}