diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-15 00:19:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-15 02:37:37 +0900 |
| commit | ac46dc8e98629719370c98e0a4760f7cd6b25578 (patch) | |
| tree | 99bb1c319c02648e6248b6c307c1fd7394455d8f /crates/shirabe-php-shim | |
| parent | 06d2d2f869cd4c8c48898fae28fb91d6716e35c2 (diff) | |
| download | php-shirabe-ac46dc8e98629719370c98e0a4760f7cd6b25578.tar.gz php-shirabe-ac46dc8e98629719370c98e0a4760f7cd6b25578.tar.zst php-shirabe-ac46dc8e98629719370c98e0a4760f7cd6b25578.zip | |
feat(port): port Zip.php
Add zip crate dependency and ZipArchive stub to shirabe-php-shim.
Also add dirname and stream_get_contents shim functions.
Diffstat (limited to 'crates/shirabe-php-shim')
| -rw-r--r-- | crates/shirabe-php-shim/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/crates/shirabe-php-shim/Cargo.toml b/crates/shirabe-php-shim/Cargo.toml index 4256d47..64bbec3 100644 --- a/crates/shirabe-php-shim/Cargo.toml +++ b/crates/shirabe-php-shim/Cargo.toml @@ -5,3 +5,4 @@ edition.workspace = true [dependencies] indexmap.workspace = true +zip.workspace = true diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 27857a5..d129479 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -254,10 +254,53 @@ impl PharData { } } +#[derive(Debug)] +pub struct ZipArchive { + pub num_files: i64, +} + +impl ZipArchive { + pub fn new() -> Self { + todo!() + } + + pub fn open(&mut self, filename: &str) -> bool { + todo!() + } + + pub fn close(&self) { + todo!() + } + + pub fn locate_name(&self, name: &str) -> Option<i64> { + todo!() + } + + pub fn get_from_index(&self, index: i64) -> Option<String> { + todo!() + } + + pub fn get_name_index(&self, index: i64) -> String { + todo!() + } + + pub fn get_stream(&self, name: &str) -> Option<PhpMixed> { + todo!() + } +} + pub trait JsonSerializable { fn json_serialize(&self) -> PhpMixed; } +pub fn dirname(path: &str) -> String { + todo!() +} + +pub fn stream_get_contents(stream: PhpMixed) -> Option<String> { + todo!() +} + pub fn class_exists(name: &str) -> bool { todo!() } |
