aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/plugin/plugin_manager.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-15 08:56:04 +0900
committernsfisis <nsfisis@gmail.com>2026-08-15 08:56:04 +0900
commitb1f74fd83663d26e14f92300f452a3c997d93d62 (patch)
treea930aee236c53e57fa13dc007ce30b60de272906 /crates/shirabe/src/plugin/plugin_manager.rs
parent2e40eaf6bf5c4bd8eedad597e4c3b19b5457421b (diff)
downloadphp-shirabe-b1f74fd83663d26e14f92300f452a3c997d93d62.tar.gz
php-shirabe-b1f74fd83663d26e14f92300f452a3c997d93d62.tar.zst
php-shirabe-b1f74fd83663d26e14f92300f452a3c997d93d62.zip
fix(php-rpc): unpack the runtime bundle under the cache dir
A worker whose PHP cannot read the bundle out of the executable gets it from an unpacked copy, which went to a directory derived from XDG_CACHE_HOME alone. That ignored COMPOSER_CACHE_DIR, COMPOSER_HOME and the cache-dir setting, and put the files outside the directory clear-cache and the platform conventions cover. The callers now pass Composer's configured cache directory down to base_path(). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/plugin/plugin_manager.rs')
-rw-r--r--crates/shirabe/src/plugin/plugin_manager.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs
index 1d8e6192..75852348 100644
--- a/crates/shirabe/src/plugin/plugin_manager.rs
+++ b/crates/shirabe/src/plugin/plugin_manager.rs
@@ -405,7 +405,12 @@ impl PluginManager {
// The plugin code runs in the PHP worker: load the Composer PHP runtime (contracts like
// PluginInterface) and the reverse-RPC autoloader before touching plugin classes there.
- EventDispatcher::ensure_composer_php_runtime()?;
+ let cache_dir = composer
+ .borrow()
+ .get_config()
+ .borrow()
+ .get_str("cache-dir")?;
+ EventDispatcher::ensure_composer_php_runtime(std::path::Path::new(&cache_dir))?;
EventDispatcher::ensure_script_autoloader()?;
if let Some(files) = map.get("files").and_then(|v| v.as_array()) {