bug #16092 [Process] Throw exception if tempnam returns false (pierredup)
This PR was merged into the 2.7 branch.
Discussion
----------
[Process] Throw exception if tempnam returns false
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #15215
| License | MIT
| Doc PR |
Commits
-------
cc854e6
Throw exception if tempnam returns false
This commit is contained in:
commit
d1f50c5dee
@ -48,12 +48,11 @@ class WindowsPipes extends AbstractPipes
|
|||||||
//
|
//
|
||||||
// @see https://bugs.php.net/bug.php?id=51800
|
// @see https://bugs.php.net/bug.php?id=51800
|
||||||
$this->files = array(
|
$this->files = array(
|
||||||
Process::STDOUT => tempnam(sys_get_temp_dir(), 'sf_proc_stdout'),
|
Process::STDOUT => tempnam(sys_get_temp_dir(), 'out_sf_proc'),
|
||||||
Process::STDERR => tempnam(sys_get_temp_dir(), 'sf_proc_stderr'),
|
Process::STDERR => tempnam(sys_get_temp_dir(), 'err_sf_proc'),
|
||||||
);
|
);
|
||||||
foreach ($this->files as $offset => $file) {
|
foreach ($this->files as $offset => $file) {
|
||||||
$this->fileHandles[$offset] = fopen($this->files[$offset], 'rb');
|
if (false === $file || false === $this->fileHandles[$offset] = fopen($file, 'rb')) {
|
||||||
if (false === $this->fileHandles[$offset]) {
|
|
||||||
throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable');
|
throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user