Skip to content

Don't rewrite it in Rust. Rewrite the 5% that's slow: profile your app, port the hot functions with your coding agent, prove they behave the same. Python, JS/TS, Ruby, Java, Kotlin, Go, PHP, C/C++, C#, R.

php: quote the prepended file's path for PHP's ini parser

Mohit Mishra36e065cb2613
diff --git a/src/php.rs b/src/php.rs
index 8a023bc..e1089c3 100644
--- a/src/php.rs
+++ b/src/php.rs
@@ -150,7 +150,9 @@ fn run_php(
) -> Result<std::process::Output> {
let mut cmd = Command::new(php);
cmd.arg("-d")
- .arg(format!("auto_prepend_file={}", prepend.display()))
+ // quoted, as an ini value: a path can hold characters ini syntax reads as operators (~ in
+ // Windows short names, like C:\Users\RUNNER~1)
+ .arg(format!("auto_prepend_file=\"{}\"", prepend.display()))
.args(args)
.current_dir(&ctx.root)
.env(DISABLE_ENV, "1")