aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/remote_filesystem.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-11 02:39:35 +0900
committernsfisis <nsfisis@gmail.com>2026-06-11 02:39:35 +0900
commit6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83 (patch)
treee39261f4aa7314fe8c75142670c76591cdaccb92 /crates/shirabe/src/util/remote_filesystem.rs
parent5d3232a80be4b989e89cc7ae4e3642cc5acae030 (diff)
downloadphp-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.tar.gz
php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.tar.zst
php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.zip
feat(console): resolve phase-b TODOs in doRun and IO wiring
Wire up ConsoleIO with HelperSet/QuestionHelper, register the ErrorHandler with the IO instance, and fall back to a default output in run(). Replace resolved phase-b TODOs across the console, command, io, factory, installer, dependency_resolver, and util modules; reclassify the remaining blockers (typed Symfony command registry, stdin resource caching) as phase-c. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/remote_filesystem.rs')
-rw-r--r--crates/shirabe/src/util/remote_filesystem.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs
index dc6a2a4..ff6f066 100644
--- a/crates/shirabe/src/util/remote_filesystem.rs
+++ b/crates/shirabe/src/util/remote_filesystem.rs
@@ -307,7 +307,13 @@ impl RemoteFilesystem {
let mut error_message = String::new();
let error_code = 0_i64;
let mut result: Option<String> = None;
- // TODO(phase-b): set_error_handler with a closure capturing `error_message` by reference.
+ // TODO(phase-c): faithfully accumulating the file_get_contents warnings into
+ // error_message requires PHP's set_error_handler runtime mechanism — a global handler the
+ // stream layer invokes per warning, appending into error_message by &-reference.
+ // set_error_handler / restore_error_handler are php-shim functions that must stay todo!(),
+ // and get_remote_contents does not surface low-level read warnings through such a side
+ // channel, so error_message stays empty here. Resolving this needs a thread-local
+ // error-handler stack wired into the I/O layer.
set_error_handler(|_code, _msg, _file, _line| true);
let mut http_response_header: Vec<String> = Vec::new();
@@ -611,7 +617,10 @@ impl RemoteFilesystem {
}
let put_error_message = String::new();
- // TODO(phase-b): set_error_handler closure that captures `put_error_message` by reference
+ // TODO(phase-c): capturing the file_put_contents warning into put_error_message
+ // requires PHP's set_error_handler runtime mechanism (see the get() method above);
+ // set_error_handler is a php-shim that must stay todo!() and file_put_contents does not
+ // surface its warning text here, so put_error_message stays empty.
set_error_handler(|_code, _msg, _file, _line| true);
let write_result =
file_put_contents(file_name.as_deref().unwrap(), result_str.as_bytes());