Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
php-cli: Don't pass the TMPDIR variable to NodePHP.load (#953)
* `npm` scripts set the TMPDIR env variable * PHP accepts a TMPDIR env variable and expects it to be a writable directory within the PHP filesystem. These two clash and prevent PHP from creating temporary files and directories so this PR prevents exposing the npm-set `TMPDIR` env variable to PHP. Closes #828 ## Testing instructions Run the following PHP script with and without this PR: ```php <?php var_dump(sys_get_temp_dir()); var_dump(tmpfile()); ``` Run it as follows: ``` nx reset; PHP=8.2 nx start php-wasm-cli ``` Without this PR, it should print something like this: ``` string(48) "/var/folders/sb/cywb762129g3f0jzq1_p2q5h0000gp/T" bool(false) ``` With this PR, it should print this: ``` string(4) "/tmp" resource(4) of type (stream) ```
- Loading branch information