From eacd2abcc53659a9fa20b1274a30ac4d9ad8bdb6 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 3 Jun 2026 20:10:17 +0900 Subject: feat(php-shim): align fwrite/touch2/PHP_OS_FAMILY/PHP_URL_SCHEME with PHP Adjust fwrite to return int|false equivalent (Option), add touch2 with mtime, implement PHP_OS_FAMILY via std::env::consts::OS, and swap the PHP_URL_HOST placeholders for the now-available PHP_URL_SCHEME. Wire these into locker, filesystem, platform, and remote_filesystem. Co-Authored-By: Claude Opus 4.8 --- crates/shirabe/src/util/filesystem.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/util/filesystem.rs') diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs index ef3d307..c7f3583 100644 --- a/crates/shirabe/src/util/filesystem.rs +++ b/crates/shirabe/src/util/filesystem.rs @@ -405,9 +405,9 @@ impl Filesystem { while !feof(source_handle.clone()) { let chunk = fread(source_handle.clone(), 1024 * 1024).unwrap_or_default(); - // TODO(phase-b): PHP fwrite returns int|false; shim currently returns (); - // assume success here. - fwrite(target_handle.clone(), &chunk, chunk.len() as i64); + if fwrite(target_handle.clone(), &chunk, chunk.len() as i64).is_none() { + return Err(e.into()); + } } fclose(source_handle); fclose(target_handle); -- cgit v1.3.1