From 94507ec2f265ca9400d64d42036ca1e8722e27da Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 20 Aug 2026 09:50:58 +0900 Subject: 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) --- .../fixtures/e2e-script-event/project/composer.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 crates/shirabe/tests/plugin/fixtures/e2e-script-event/project/composer.json (limited to 'crates/shirabe/tests/plugin/fixtures/e2e-script-event/project/composer.json') diff --git a/crates/shirabe/tests/plugin/fixtures/e2e-script-event/project/composer.json b/crates/shirabe/tests/plugin/fixtures/e2e-script-event/project/composer.json new file mode 100644 index 00000000..59fc8f13 --- /dev/null +++ b/crates/shirabe/tests/plugin/fixtures/e2e-script-event/project/composer.json @@ -0,0 +1,17 @@ +{ + "name": "shirabe/e2e-script-event", + "description": "E2E fixture project: record what a post-autoload-dump PHP script sees on its Event.", + "repositories": [ + { + "packagist.org": false + } + ], + "autoload": { + "psr-4": { + "Shirabe\\E2e\\": "src/" + } + }, + "scripts": { + "post-autoload-dump": "Shirabe\\E2e\\ScriptEventRecorder::postAutoloadDump" + } +} -- cgit v1.3.1-4-g156e