From b65e338d4cf06afb8237512e49a51e354277196d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 10 Aug 2026 23:47:33 +0900 Subject: feat(console): import scripts Command classes as application commands `Application::do_run` registers a `composer.json` script whose value names a `Symfony\Component\Console\Command\Command` subclass as a live command. The class checks and `new $dummy($script)` need a real PHP runtime, so they run in the worker: the command object lives there and this side keeps a metadata mirror for `list`/`help`, forwarding a run to the worker-side console application it is added to. The name and description fixups are applied to the worker-side object, so both sides carry the same values. Loading the Composer PHP runtime into the worker is gated on the Rust-side `ClassLoader`s resolving the class to a file, keeping that load out of every run whose scripts are plain shell commands. The worker-side console application handoff now accepts commands registered after it was published, since the scripts scan runs after plugin commands are collected. Whether it was published is tracked per application: the handoff is process-wide, so a second application must replace it rather than extend it. `shirabe_php_shim::is_subclass_of` has no callers left. --- crates/shirabe-php-shim/src/var.rs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'crates/shirabe-php-shim/src') diff --git a/crates/shirabe-php-shim/src/var.rs b/crates/shirabe-php-shim/src/var.rs index bf8fa0ce..293997e4 100644 --- a/crates/shirabe-php-shim/src/var.rs +++ b/crates/shirabe-php-shim/src/var.rs @@ -206,11 +206,6 @@ pub fn loosely_compare(a: &str, b: &str) -> std::cmp::Ordering { } } -pub fn is_subclass_of(_object_or_class: &PhpMixed, _class_name: &str, _allow_string: bool) -> bool { - // TODO(php-runtime): requires runtime class ancestry, which PhpMixed::Object does not carry. - todo!() -} - pub fn get_class(_object: &PhpMixed) -> String { // TODO(php-runtime): PhpMixed::Object carries no class name; there is no runtime class to report. todo!() -- cgit v1.3.1-4-g156e