Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7c29f08

Browse filesBrowse files
[Process] Fix AbstractPipes::write() for a situation seen on HHVM (at least)
1 parent 8e01a2a commit 7c29f08
Copy full SHA for 7c29f08

File tree

3 files changed

+4
-6
lines changed
Filter options

3 files changed

+4
-6
lines changed

‎src/Symfony/Component/Process/Pipes/AbstractPipes.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Pipes/AbstractPipes.php
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function write()
111111
if ($input) {
112112
for (;;) {
113113
$data = fread($input, self::CHUNK_SIZE);
114-
if (false === $data || '' === $data) {
114+
if (!isset($data[0])) {
115115
break;
116116
}
117117
$written = fwrite($stdin, $data);
@@ -134,9 +134,7 @@ protected function write()
134134
if (null === $this->input && !isset($this->inputBuffer[0])) {
135135
fclose($this->pipes[0]);
136136
unset($this->pipes[0]);
137-
}
138-
139-
if (!$w) {
137+
} elseif (!$w) {
140138
return array($this->pipes[0]);
141139
}
142140
}

‎src/Symfony/Component/Process/Pipes/UnixPipes.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Pipes/UnixPipes.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function readAndWrite($blocking, $close = false)
120120
do {
121121
$data = fread($pipe, self::CHUNK_SIZE);
122122
$read[$type] .= $data;
123-
} while (false !== $data && '' !== $data);
123+
} while (isset($data[0]));
124124

125125
if (!isset($read[$type][0])) {
126126
unset($read[$type]);

‎src/Symfony/Component/Process/Pipes/WindowsPipes.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Pipes/WindowsPipes.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function readAndWrite($blocking, $close = false)
139139
foreach ($this->fileHandles as $type => $fileHandle) {
140140
$data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]);
141141

142-
if (false !== $data && '' !== $data) {
142+
if (isset($data[0])) {
143143
$this->readBytes[$type] += strlen($data);
144144
$read[$type] = $data;
145145
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.