Skip to content

Commit 56ce236

Browse files
committed
Use Environment to obtain PHP binary
This improves support for HHVM by ensuring we use the HHVM binary for child processes and invoke it with the "--php" command line option.
1 parent 12a86b0 commit 56ce236

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"react/event-loop": "0.3.*|0.4.*",
1010
"react/stream": "0.3.*|0.4.*"
1111
},
12+
"require-dev": {
13+
"sebastian/environment": "~1.0"
14+
},
1215
"autoload": {
1316
"psr-4": { "React\\ChildProcess\\": "src" }
1417
},

tests/AbstractProcessTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use React\ChildProcess\Process;
66
use React\EventLoop\Timer\Timer;
7+
use SebastianBergmann\Environment\Runtime;
78

89
abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
910
{
@@ -329,6 +330,8 @@ public function assertSoon(\Closure $callback, $timeout = 20000, $interval = 200
329330

330331
private function getPhpBinary()
331332
{
332-
return defined('PHP_BINARY') ? PHP_BINARY : 'php';
333+
$runtime = new Runtime();
334+
335+
return $runtime->getBinary();
333336
}
334337
}

0 commit comments

Comments
 (0)