From 910e124b34c9f05d8b45f73b1f74f5585a6e79b2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 26 Jun 2026 01:16:03 +0900 Subject: feat(php-shim): stub spl_autoload_register/unregister (TODO-flagged) Compiled Rust never loads a class by name, so the registered callback is dropped. Return success so callers that register an autoloader during startup can proceed. Kept the TODO(phase-d) comment: this is an unblocking stub, not a faithful implementation. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-php-shim/src/runtime.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs index d051f3d..e002138 100644 --- a/crates/shirabe-php-shim/src/runtime.rs +++ b/crates/shirabe-php-shim/src/runtime.rs @@ -227,14 +227,15 @@ pub fn spl_autoload_register( ) -> bool { let _ = (callback, throw, prepend); // TODO(phase-d): class autoloading has no analogue in compiled Rust (classes are not loaded by - // name at runtime). - todo!() + // name at runtime), so the callback is dropped. Returns success so callers that register an + // autoloader during startup can proceed; this is not a faithful implementation. + true } pub fn spl_autoload_unregister(callback: Box PhpMixed + Send + Sync>) -> bool { let _ = callback; - // TODO(phase-d): see spl_autoload_register. - todo!() + // TODO(phase-d): see spl_autoload_register; nothing is registered, so this is a no-op stub. + true } static ERROR_REPORTING_LEVEL: std::sync::atomic::AtomicI64 = -- cgit v1.3.1