aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/platform
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-19 00:10:22 +0900
committernsfisis <nsfisis@gmail.com>2026-05-19 00:11:03 +0900
commitc839244d8d09f3036ebfee8eef7eb6b147e593ab (patch)
treefe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/platform
parent48839250146b217e2756ed3c0e624fd341b54d6c (diff)
downloadphp-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/platform')
-rw-r--r--crates/shirabe/src/platform/hhvm_detector.rs24
1 files changed, 15 insertions, 9 deletions
diff --git a/crates/shirabe/src/platform/hhvm_detector.rs b/crates/shirabe/src/platform/hhvm_detector.rs
index c6a53cb..b425bfe 100644
--- a/crates/shirabe/src/platform/hhvm_detector.rs
+++ b/crates/shirabe/src/platform/hhvm_detector.rs
@@ -9,6 +9,7 @@ use std::sync::Mutex;
// None = null (uninitialized), Some(None) = false (not found), Some(Some(v)) = version
static HHVM_VERSION_CACHE: Mutex<Option<Option<String>>> = Mutex::new(None);
+#[derive(Debug)]
pub struct HhvmDetector {
executable_finder: Option<ExecutableFinder>,
process_executor: Option<ProcessExecutor>,
@@ -47,25 +48,30 @@ impl HhvmDetector {
let finder = self
.executable_finder
.get_or_insert_with(ExecutableFinder::new);
- let hhvm_path = finder.find("hhvm");
+ let hhvm_path = finder.find("hhvm", None, &[]);
if let Some(hhvm_path) = hhvm_path {
let executor = self
.process_executor
- .get_or_insert_with(ProcessExecutor::new);
- let mut version_output = String::new();
- let exit_code = executor.execute(
- &[
- &hhvm_path,
+ .get_or_insert_with(|| ProcessExecutor::new(None, None));
+ let mut version_output = shirabe_php_shim::PhpMixed::Null;
+ let cmd = shirabe_php_shim::PhpMixed::List(
+ [
+ hhvm_path.as_str(),
"--php",
"-d",
"hhvm.jit=0",
"-r",
"echo HHVM_VERSION;",
- ],
- &mut version_output,
+ ]
+ .into_iter()
+ .map(|s| Box::new(shirabe_php_shim::PhpMixed::String(s.to_string())))
+ .collect(),
);
+ let exit_code = executor
+ .execute(cmd, Some(&mut version_output), None)
+ .unwrap_or(1);
if exit_code == 0 {
- *cache = Some(Some(version_output));
+ *cache = Some(version_output.as_string().map(|s| s.to_string()));
}
}
}