aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/console/application.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/console/application.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/console/application.rs')
-rw-r--r--crates/shirabe/src/console/application.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 56947243..1c0f0560 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -2439,7 +2439,19 @@ impl ApplicationHandle {
&& crate::plugin::find_file_in_registered_loaders(&dummy_str)
.is_some()
&& {
- EventDispatcher::ensure_composer_php_runtime()?;
+ let cache_dir = match composer_opt {
+ Some(ref composer_handle) => {
+ crate::composer::composer_full(composer_handle)
+ .get_config()
+ .borrow()
+ .get_str("cache-dir")?
+ }
+ None => Factory::create_config(Some(io.clone()), None)?
+ .get_str("cache-dir")?,
+ };
+ EventDispatcher::ensure_composer_php_runtime(
+ std::path::Path::new(&cache_dir),
+ )?;
crate::plugin::php_class_query(
"class_exists",
vec![shirabe_php_rpc::PluginValue::string(