diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-13 23:18:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-13 23:18:41 +0900 |
| commit | e165b2ffa32e21c50787ae7227dc5333131d1414 (patch) | |
| tree | a10e4218bcb93085ebbe3acb5369fdc1d88176c8 /crates/shirabe-php-shim/src/lib.rs | |
| parent | 69c372ba0eca61b05260d6d208445d9e69d14e34 (diff) | |
| download | php-shirabe-e165b2ffa32e21c50787ae7227dc5333131d1414.tar.gz php-shirabe-e165b2ffa32e21c50787ae7227dc5333131d1414.tar.zst php-shirabe-e165b2ffa32e21c50787ae7227dc5333131d1414.zip | |
refactor(http): drop unworkable set_error_handler warning capture
PHP wraps fopen/file_get_contents/file_put_contents in set_error_handler
to capture warning text into error_message. Rust reports I/O failures
through return values rather than warnings, so this side channel cannot
work; replace the calls with TODO(phase-c) notes and leave error_message
empty until the I/O layer surfaces a reason. Also remove the now-unused
set_error_handler_closure shim and make set_error_handler a no-op.
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.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 59626ea..3ec8296 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -1239,9 +1239,8 @@ pub fn include_file(file: &str) -> PhpMixed { todo!() } -pub fn set_error_handler(_callback: fn(i64, &str, &str, i64) -> bool) { - todo!() -} +// TODO(php-runtime): the callback should be registered in PHP runtime. +pub fn set_error_handler(_callback: fn(i64, &str, &str, i64) -> bool) {} pub fn debug_backtrace() -> Vec<IndexMap<String, Box<PhpMixed>>> { todo!() @@ -1598,12 +1597,6 @@ pub fn restore_error_handler() { todo!() } -/// Closure-capturing variant of PHP `set_error_handler()`. -pub fn set_error_handler_closure(callback: Box<dyn FnMut(i64, &str) -> bool>) { - let _ = callback; - todo!() -} - pub fn stream_get_contents_with_max(stream: PhpMixed, max_length: Option<i64>) -> Option<String> { let _ = (stream, max_length); todo!() |
