Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e8d844

Browse files
committed
[Process] Warn user with a useful message when tmpfile() failed
1 parent 0209eb6 commit 5e8d844

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ public function start($callback = null)
213213
$this->fileHandles = array(
214214
self::STDOUT => tmpfile(),
215215
);
216+
if (false === $this->fileHandles[self::STDOUT]) {
217+
throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable');
218+
}
216219
$this->readBytes = array(
217220
self::STDOUT => 0,
218221
);

0 commit comments

Comments
 (0)