aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/plugin/main.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-20 09:50:58 +0900
committernsfisis <nsfisis@gmail.com>2026-08-20 09:50:58 +0900
commit94507ec2f265ca9400d64d42036ca1e8722e27da (patch)
treefca64359a8d9257717bc41822ae7119bdc3e2b26 /crates/shirabe/tests/plugin/main.rs
parent80c2120a64ce9b989da288ce1fcf80dec5cf38c1 (diff)
downloadphp-shirabe-94507ec2f265ca9400d64d42036ca1e8722e27da.tar.gz
php-shirabe-94507ec2f265ca9400d64d42036ca1e8722e27da.tar.zst
php-shirabe-94507ec2f265ca9400d64d42036ca1e8722e27da.zip
fix(event-dispatcher): let a PHP script reach the Composer object graph
A PHP script listener that walks the event it receives (Laravel's Illuminate\Foundation\ComposerScripts::postAutoloadDump asks for $event->getComposer()->getConfig()->get('vendor-dir')) aborted the run with `unknown Rust handle 2`. The event's getComposer/getIO answers register an entity in the R table and hand back its rhandle, but ScriptRpcDispatcher resolved only rhandle 0 and the one event handle of the call in flight, so it could not serve a method on a handle it had just minted itself. The R-table lookup PluginRpcDispatcher already does is now dispatch_r_table_method, shared by both. The stubs that graph hands out extend and implement the real Composer contracts (Composer\Package\PackageInterface and the rest), which live in the Composer PHP runtime and not among the generated stubs or guards, so execute_event_php_script loads that runtime the way the plugin and command-class paths do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/plugin/main.rs')
-rw-r--r--crates/shirabe/tests/plugin/main.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/shirabe/tests/plugin/main.rs b/crates/shirabe/tests/plugin/main.rs
index d8defcbc..000ca3a9 100644
--- a/crates/shirabe/tests/plugin/main.rs
+++ b/crates/shirabe/tests/plugin/main.rs
@@ -13,6 +13,7 @@ mod e2e_installers_test;
mod e2e_normalize_test;
mod e2e_package_event_test;
mod e2e_script_command_test;
+mod e2e_script_event_test;
mod plugin_installer_test;
mod subscriber_test;
mod value_round_trip_test;