From 06d2c5c884eee0b5b663730f4d379a7ceae3a8e4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 1 Aug 2026 05:26:16 +0900 Subject: feat(php-shim): implement Phar/PharData and the zlib/bzip2 functions Adopt the tar, flate2, and bzip2 crates to fill in the phar.rs and compress.rs todos: PharData tar/zip reading, building, and whole-archive compression, plus a native .phar reader that follows the php.net file-format manual and verifies hash-based signatures. Callers now propagate the constructor/extract errors PHP throws, and fwrite accepts byte strings so gzread no longer needs lossy UTF-8. The native .phar writing API stays todo!() (no call sites; Composer's Compiler is not ported) and OPENSSL phar signatures are accepted unverified (TODO(phase-c)). This unblocks Tar::getComposerJson and the tar/phar/gzip downloaders; tar_test (7), artifact_repository_test (2), and phar_archiver_test zip (1) are un-ignored. The archive command itself still panics because ArchiveManager::archive always generates glob excludes whose look-ahead regexes the regex crate cannot compile; converting those patterns to regex-compatible ones is a separate, still-undecided work item. Co-Authored-By: Claude Fable 5 --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 396ae913..3fc7c926 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,10 @@ shirabe-spdx-licenses = { path = "crates/shirabe-spdx-licenses" } anyhow = "1.0.102" async-trait = "0.1.89" base64 = "0.22.1" +bzip2 = "0.6.1" chrono = { version = "0.4.44", features = ["serde"] } fastrand = "2.4.1" +flate2 = "1.1.9" futures = "0.3.32" indexmap = { version = "2.14.0", features = ["serde"] } jsonschema = { version = "0.46.6", default-features = false } @@ -35,6 +37,7 @@ serde_urlencoded = "0.7.1" serial_test = "3.5.0" sha1 = "0.11.0" sha2 = "0.11.0" +tar = "0.4.46" tempfile = "3.27.0" tokio = { version = "1.52.3", features = ["full"] } tracing = "0.1.44" -- cgit v1.3.1