Skip to content

Commit

Permalink
Use deterministic path for exe copy outside phar
Browse files Browse the repository at this point in the history
Fixes #37.
  • Loading branch information
kelunik committed Mar 6, 2019
1 parent 355b1e5 commit 2dcddfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Internal/Windows/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private function makeCommand(string $workingDirectory): string
// We can't execute the exe from within the PHAR, so copy it out...
if (\strncmp($wrapperPath, "phar://", 7) === 0) {
if (self::$pharWrapperPath === null) {
self::$pharWrapperPath = \tempnam(\sys_get_temp_dir(), "amphp-process-wrapper-");
self::$pharWrapperPath = \sys_get_temp_dir() . "amphp-process-wrapper-" . \hash('sha1', \file_get_contents(self::WRAPPER_EXE_PATH));
\copy(self::WRAPPER_EXE_PATH, self::$pharWrapperPath);

\register_shutdown_function(static function () {
Expand Down

0 comments on commit 2dcddfb

Please sign in to comment.