Skip to content

Commit

Permalink
Better Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Sep 29, 2015
1 parent cf1455b commit 1cf7dd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
}, 1, 0);

$paths = [
dirname(dirname(dirname(__DIR__))) . '/autoload.php',
dirname(__DIR__) . '/vendor/autoload.php',
dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'autoload.php',
dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php',
];

$autoloadPath = null;
Expand Down
4 changes: 3 additions & 1 deletion src/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ public function start()
['pipe', 'w'], // exit code pipe
];

$command = sprintf('(%s) 3>/dev/null; code=$?; echo $code >&3; exit $code', $this->command);
$nd = 0 === strncasecmp(PHP_OS, 'WIN', 3) ? 'NUL' : '/dev/null';

$command = sprintf('(%s) 3>%s; code=$?; echo $code >&3; exit $code', $this->command, $nd);

$this->process = proc_open($command, $fd, $pipes, $this->cwd ?: null, $this->env ?: null, $this->options);

Expand Down

1 comment on commit 1cf7dd6

@sagebind
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.