| @@ 115-124 (lines=10) @@ | ||
| 112 | } |
|
| 113 | ||
| 114 | $len = 0; |
|
| 115 | while (false === $stream->eof() && $len < $maxLen) { |
|
| 116 | $buf = $stream->read($maxLen - $len); |
|
| 117 | // Using a loose equality here to match on '' and false. |
|
| 118 | if (null === $buf) { |
|
| 119 | break; |
|
| 120 | } |
|
| 121 | ||
| 122 | $buffer .= $buf; |
|
| 123 | $len = strlen($buffer); |
|
| 124 | } |
|
| 125 | ||
| 126 | return $buffer; |
|
| 127 | } |
|
| @@ 188-200 (lines=13) @@ | ||
| 185 | } |
|
| 186 | ||
| 187 | $bytes = 0; |
|
| 188 | while (false === $source->eof()) { |
|
| 189 | $buf = $source->read($maxLen - $bytes); |
|
| 190 | if (false === ($len = strlen($buf))) { |
|
| 191 | break; |
|
| 192 | } |
|
| 193 | ||
| 194 | $bytes += $len; |
|
| 195 | $dest->write($buf); |
|
| 196 | ||
| 197 | if ($bytes == $maxLen) { |
|
| 198 | break; |
|
| 199 | } |
|
| 200 | } |
|
| 201 | } |
|
| 202 | ||
| 203 | ||