| 1 |
liveuser |
1 |
# Changelog
|
|
|
2 |
|
|
|
3 |
## 1.1.1 (2020-05-04)
|
|
|
4 |
|
|
|
5 |
* Fix: Fix faulty write buffer behavior when sending large data chunks over TLS (Mac OS X only).
|
|
|
6 |
(#150 by @clue)
|
|
|
7 |
|
|
|
8 |
* Minor code style improvements to fix phpstan analysis warnings and
|
|
|
9 |
add `.gitattributes` to exclude dev files from exports.
|
|
|
10 |
(#140 by @flow-control and #144 by @reedy)
|
|
|
11 |
|
|
|
12 |
* Improve test suite to run tests on PHP 7.4 and simplify test matrix.
|
|
|
13 |
(#147 by @clue)
|
|
|
14 |
|
|
|
15 |
## 1.1.0 (2019-01-01)
|
|
|
16 |
|
|
|
17 |
* Improvement: Increase performance by optimizing global function and constant look ups.
|
|
|
18 |
(#137 by @WyriHaximus)
|
|
|
19 |
|
|
|
20 |
* Travis: Test against PHP 7.3.
|
|
|
21 |
(#138 by @WyriHaximus)
|
|
|
22 |
|
|
|
23 |
* Fix: Ignore empty reads.
|
|
|
24 |
(#139 by @WyriHaximus)
|
|
|
25 |
|
|
|
26 |
## 1.0.0 (2018-07-11)
|
|
|
27 |
|
|
|
28 |
* First stable LTS release, now following [SemVer](https://semver.org/).
|
|
|
29 |
We'd like to emphasize that this component is production ready and battle-tested.
|
|
|
30 |
We plan to support all long-term support (LTS) releases for at least 24 months,
|
|
|
31 |
so you have a rock-solid foundation to build on top of.
|
|
|
32 |
|
|
|
33 |
> Contains no other changes, so it's actually fully compatible with the v0.7.7 release.
|
|
|
34 |
|
|
|
35 |
## 0.7.7 (2018-01-19)
|
|
|
36 |
|
|
|
37 |
* Improve test suite by fixing forward compatibility with upcoming EventLoop
|
|
|
38 |
releases, avoid risky tests and add test group to skip integration tests
|
|
|
39 |
relying on internet connection and apply appropriate test timeouts.
|
|
|
40 |
(#128, #131 and #132 by @clue)
|
|
|
41 |
|
|
|
42 |
## 0.7.6 (2017-12-21)
|
|
|
43 |
|
|
|
44 |
* Fix: Work around reading from unbuffered pipe stream in legacy PHP < 5.4.28 and PHP < 5.5.12
|
|
|
45 |
(#126 by @clue)
|
|
|
46 |
|
|
|
47 |
* Improve test suite by simplifying test bootstrapping logic via Composer and
|
|
|
48 |
test against PHP 7.2
|
|
|
49 |
(#127 by @clue and #124 by @carusogabriel)
|
|
|
50 |
|
|
|
51 |
## 0.7.5 (2017-11-20)
|
|
|
52 |
|
|
|
53 |
* Fix: Igore excessive `fopen()` mode flags for `WritableResourceStream`
|
|
|
54 |
(#119 by @clue)
|
|
|
55 |
|
|
|
56 |
* Fix: Fix forward compatibility with upcoming EventLoop releases
|
|
|
57 |
(#121 by @clue)
|
|
|
58 |
|
|
|
59 |
* Restructure examples to ease getting started
|
|
|
60 |
(#123 by @clue)
|
|
|
61 |
|
|
|
62 |
* Improve test suite by adding forward compatibility with PHPUnit 6 and
|
|
|
63 |
ignore Mac OS X test failures for now until Travis tests work again
|
|
|
64 |
(#122 by @gabriel-caruso and #120 by @clue)
|
|
|
65 |
|
|
|
66 |
## 0.7.4 (2017-10-11)
|
|
|
67 |
|
|
|
68 |
* Fix: Remove event listeners from `CompositeStream` once closed and
|
|
|
69 |
remove undocumented left-over `close` event argument
|
|
|
70 |
(#116 by @clue)
|
|
|
71 |
|
|
|
72 |
* Minor documentation improvements: Fix wrong class name in example,
|
|
|
73 |
fix typos in README and
|
|
|
74 |
fix forward compatibility with upcoming EventLoop releases in example
|
|
|
75 |
(#113 by @docteurklein and #114 and #115 by @clue)
|
|
|
76 |
|
|
|
77 |
* Improve test suite by running against Mac OS X on Travis
|
|
|
78 |
(#112 by @clue)
|
|
|
79 |
|
|
|
80 |
## 0.7.3 (2017-08-05)
|
|
|
81 |
|
|
|
82 |
* Improvement: Support Événement 3.0 a long side 2.0 and 1.0
|
|
|
83 |
(#108 by @WyriHaximus)
|
|
|
84 |
|
|
|
85 |
* Readme: Corrected loop initialization in usage example
|
|
|
86 |
(#109 by @pulyavin)
|
|
|
87 |
|
|
|
88 |
* Travis: Lock linux distribution preventing future builds from breaking
|
|
|
89 |
(#110 by @clue)
|
|
|
90 |
|
|
|
91 |
## 0.7.2 (2017-06-15)
|
|
|
92 |
|
|
|
93 |
* Bug fix: WritableResourceStream: Close the underlying stream when closing the stream.
|
|
|
94 |
(#107 by @WyriHaximus)
|
|
|
95 |
|
|
|
96 |
## 0.7.1 (2017-05-20)
|
|
|
97 |
|
|
|
98 |
* Feature: Add optional `$writeChunkSize` parameter to limit maximum number of
|
|
|
99 |
bytes to write at once.
|
|
|
100 |
(#105 by @clue)
|
|
|
101 |
|
|
|
102 |
```php
|
|
|
103 |
$stream = new WritableResourceStream(STDOUT, $loop, null, 8192);
|
|
|
104 |
```
|
|
|
105 |
|
|
|
106 |
* Ignore HHVM test failures for now until Travis tests work again
|
|
|
107 |
(#106 by @clue)
|
|
|
108 |
|
|
|
109 |
## 0.7.0 (2017-05-04)
|
|
|
110 |
|
|
|
111 |
* Removed / BC break: Remove deprecated and unneeded functionality
|
|
|
112 |
(#45, #87, #90, #91 and #93 by @clue)
|
|
|
113 |
|
|
|
114 |
* Remove deprecated `Stream` class, use `DuplexResourceStream` instead
|
|
|
115 |
(#87 by @clue)
|
|
|
116 |
|
|
|
117 |
* Remove public `$buffer` property, use new constructor parameters instead
|
|
|
118 |
(#91 by @clue)
|
|
|
119 |
|
|
|
120 |
* Remove public `$stream` property from all resource streams
|
|
|
121 |
(#90 by @clue)
|
|
|
122 |
|
|
|
123 |
* Remove undocumented and now unused `ReadableStream` and `WritableStream`
|
|
|
124 |
(#93 by @clue)
|
|
|
125 |
|
|
|
126 |
* Remove `BufferedSink`
|
|
|
127 |
(#45 by @clue)
|
|
|
128 |
|
|
|
129 |
* Feature / BC break: Simplify `ThroughStream` by using data callback instead of
|
|
|
130 |
inheritance. It is now a direct implementation of `DuplexStreamInterface`.
|
|
|
131 |
(#88 and #89 by @clue)
|
|
|
132 |
|
|
|
133 |
```php
|
|
|
134 |
$through = new ThroughStream(function ($data) {
|
|
|
135 |
return json_encode($data) . PHP_EOL;
|
|
|
136 |
});
|
|
|
137 |
$through->on('data', $this->expectCallableOnceWith("[2, true]\n"));
|
|
|
138 |
|
|
|
139 |
$through->write(array(2, true));
|
|
|
140 |
```
|
|
|
141 |
|
|
|
142 |
* Feature / BC break: The `CompositeStream` starts closed if either side is
|
|
|
143 |
already closed and forwards pause to pipe source on first write attempt.
|
|
|
144 |
(#96 and #103 by @clue)
|
|
|
145 |
|
|
|
146 |
If either side of the composite stream closes, it will also close the other
|
|
|
147 |
side. We now also ensure that if either side is already closed during
|
|
|
148 |
instantiation, it will also close the other side.
|
|
|
149 |
|
|
|
150 |
* BC break: Mark all classes as `final` and
|
|
|
151 |
mark internal API as `private` to discourage inheritance
|
|
|
152 |
(#95 and #99 by @clue)
|
|
|
153 |
|
|
|
154 |
* Feature / BC break: Only emit `error` event for fatal errors
|
|
|
155 |
(#92 by @clue)
|
|
|
156 |
|
|
|
157 |
> The `error` event was previously also allowed to be emitted for non-fatal
|
|
|
158 |
errors, but our implementations actually only ever emitted this as a fatal
|
|
|
159 |
error and then closed the stream.
|
|
|
160 |
|
|
|
161 |
* Feature: Explicitly allow custom events and exclude any semantics
|
|
|
162 |
(#97 by @clue)
|
|
|
163 |
|
|
|
164 |
* Strict definition for event callback functions
|
|
|
165 |
(#101 by @clue)
|
|
|
166 |
|
|
|
167 |
* Support legacy PHP 5.3 through PHP 7.1 and HHVM and improve usage documentation
|
|
|
168 |
(#100 and #102 by @clue)
|
|
|
169 |
|
|
|
170 |
* Actually require all dependencies so this is self-contained and improve
|
|
|
171 |
forward compatibility with EventLoop v1.0 and v0.5
|
|
|
172 |
(#94 and #98 by @clue)
|
|
|
173 |
|
|
|
174 |
## 0.6.0 (2017-03-26)
|
|
|
175 |
|
|
|
176 |
* Feature / Fix / BC break: Add `DuplexResourceStream` and deprecate `Stream`
|
|
|
177 |
(#85 by @clue)
|
|
|
178 |
|
|
|
179 |
```php
|
|
|
180 |
// old (does still work for BC reasons)
|
|
|
181 |
$stream = new Stream($connection, $loop);
|
|
|
182 |
|
|
|
183 |
// new
|
|
|
184 |
$stream = new DuplexResourceStream($connection, $loop);
|
|
|
185 |
```
|
|
|
186 |
|
|
|
187 |
Note that the `DuplexResourceStream` now rejects read-only or write-only
|
|
|
188 |
streams, so this may affect BC. If you want a read-only or write-only
|
|
|
189 |
resource, use `ReadableResourceStream` or `WritableResourceStream` instead of
|
|
|
190 |
`DuplexResourceStream`.
|
|
|
191 |
|
|
|
192 |
> BC note: This class was previously called `Stream`. The `Stream` class still
|
|
|
193 |
exists for BC reasons and will be removed in future versions of this package.
|
|
|
194 |
|
|
|
195 |
* Feature / BC break: Add `WritableResourceStream` (previously called `Buffer`)
|
|
|
196 |
(#84 by @clue)
|
|
|
197 |
|
|
|
198 |
```php
|
|
|
199 |
// old
|
|
|
200 |
$stream = new Buffer(STDOUT, $loop);
|
|
|
201 |
|
|
|
202 |
// new
|
|
|
203 |
$stream = new WritableResourceStream(STDOUT, $loop);
|
|
|
204 |
```
|
|
|
205 |
|
|
|
206 |
* Feature: Add `ReadableResourceStream`
|
|
|
207 |
(#83 by @clue)
|
|
|
208 |
|
|
|
209 |
```php
|
|
|
210 |
$stream = new ReadableResourceStream(STDIN, $loop);
|
|
|
211 |
```
|
|
|
212 |
|
|
|
213 |
* Fix / BC Break: Enforce using non-blocking I/O
|
|
|
214 |
(#46 by @clue)
|
|
|
215 |
|
|
|
216 |
> BC note: This is known to affect process pipes on Windows which do not
|
|
|
217 |
support non-blocking I/O and could thus block the whole EventLoop previously.
|
|
|
218 |
|
|
|
219 |
* Feature / Fix / BC break: Consistent semantics for
|
|
|
220 |
`DuplexStreamInterface::end()` to ensure it SHOULD also end readable side
|
|
|
221 |
(#86 by @clue)
|
|
|
222 |
|
|
|
223 |
* Fix: Do not use unbuffered reads on pipe streams for legacy PHP < 5.4
|
|
|
224 |
(#80 by @clue)
|
|
|
225 |
|
|
|
226 |
## 0.5.0 (2017-03-08)
|
|
|
227 |
|
|
|
228 |
* Feature / BC break: Consistent `end` event semantics (EOF)
|
|
|
229 |
(#70 by @clue)
|
|
|
230 |
|
|
|
231 |
The `end` event will now only be emitted for a *successful* end, not if the
|
|
|
232 |
stream closes due to an unrecoverable `error` event or if you call `close()`
|
|
|
233 |
explicitly.
|
|
|
234 |
If you want to detect when the stream closes (terminates), use the `close`
|
|
|
235 |
event instead.
|
|
|
236 |
|
|
|
237 |
* BC break: Remove custom (undocumented) `full-drain` event from `Buffer`
|
|
|
238 |
(#63 and #68 by @clue)
|
|
|
239 |
|
|
|
240 |
> The `full-drain` event was undocumented and mostly used internally.
|
|
|
241 |
Relying on this event has attracted some low-quality code in the past, so
|
|
|
242 |
we've removed this from the public API in order to work out a better
|
|
|
243 |
solution instead.
|
|
|
244 |
If you want to detect when the buffer finishes flushing data to the stream,
|
|
|
245 |
you may want to look into its `end()` method or the `close` event instead.
|
|
|
246 |
|
|
|
247 |
* Feature / BC break: Consistent event semantics and documentation,
|
|
|
248 |
explicitly state *when* events will be emitted and *which* arguments they
|
|
|
249 |
receive.
|
|
|
250 |
(#73 and #69 by @clue)
|
|
|
251 |
|
|
|
252 |
The documentation now explicitly defines each event and its arguments.
|
|
|
253 |
Custom events and event arguments are still supported.
|
|
|
254 |
Most notably, all defined events only receive inherently required event
|
|
|
255 |
arguments and no longer transmit the instance they are emitted on for
|
|
|
256 |
consistency and performance reasons.
|
|
|
257 |
|
|
|
258 |
```php
|
|
|
259 |
// old (inconsistent and not supported by all implementations)
|
|
|
260 |
$stream->on('data', function ($data, $stream) {
|
|
|
261 |
// process $data
|
|
|
262 |
});
|
|
|
263 |
|
|
|
264 |
// new (consistent throughout the whole ecosystem)
|
|
|
265 |
$stream->on('data', function ($data) use ($stream) {
|
|
|
266 |
// process $data
|
|
|
267 |
});
|
|
|
268 |
```
|
|
|
269 |
|
|
|
270 |
> This mostly adds documentation (and thus some stricter, consistent
|
|
|
271 |
definitions) for the existing behavior, it does NOT define any major
|
|
|
272 |
changes otherwise.
|
|
|
273 |
Most existing code should be compatible with these changes, unless
|
|
|
274 |
it relied on some undocumented/unintended semantics.
|
|
|
275 |
|
|
|
276 |
* Feature / BC break: Consistent method semantics and documentation
|
|
|
277 |
(#72 by @clue)
|
|
|
278 |
|
|
|
279 |
> This mostly adds documentation (and thus some stricter, consistent
|
|
|
280 |
definitions) for the existing behavior, it does NOT define any major
|
|
|
281 |
changes otherwise.
|
|
|
282 |
Most existing code should be compatible with these changes, unless
|
|
|
283 |
it relied on some undocumented/unintended semantics.
|
|
|
284 |
|
|
|
285 |
* Feature: Consistent `pipe()` semantics for closed and closing streams
|
|
|
286 |
(#71 from @clue)
|
|
|
287 |
|
|
|
288 |
The source stream will now always be paused via `pause()` when the
|
|
|
289 |
destination stream closes. Also, properly stop piping if the source
|
|
|
290 |
stream closes and remove all event forwarding.
|
|
|
291 |
|
|
|
292 |
* Improve test suite by adding PHPUnit to `require-dev` and improving coverage.
|
|
|
293 |
(#74 and #75 by @clue, #66 by @nawarian)
|
|
|
294 |
|
|
|
295 |
## 0.4.6 (2017-01-25)
|
|
|
296 |
|
|
|
297 |
* Feature: The `Buffer` can now be injected into the `Stream` (or be used standalone)
|
|
|
298 |
(#62 by @clue)
|
|
|
299 |
|
|
|
300 |
* Fix: Forward `close` event only once for `CompositeStream` and `ThroughStream`
|
|
|
301 |
(#60 by @clue)
|
|
|
302 |
|
|
|
303 |
* Fix: Consistent `close` event behavior for `Buffer`
|
|
|
304 |
(#61 by @clue)
|
|
|
305 |
|
|
|
306 |
## 0.4.5 (2016-11-13)
|
|
|
307 |
|
|
|
308 |
* Feature: Support setting read buffer size to `null` (infinite)
|
|
|
309 |
(#42 by @clue)
|
|
|
310 |
|
|
|
311 |
* Fix: Do not emit `full-drain` event if `Buffer` is closed during `drain` event
|
|
|
312 |
(#55 by @clue)
|
|
|
313 |
|
|
|
314 |
* Vastly improved performance by factor of 10x to 20x.
|
|
|
315 |
Raise default buffer sizes to 64 KiB and simplify and improve error handling
|
|
|
316 |
and unneeded function calls.
|
|
|
317 |
(#53, #55, #56 by @clue)
|
|
|
318 |
|
|
|
319 |
## 0.4.4 (2016-08-22)
|
|
|
320 |
|
|
|
321 |
* Bug fix: Emit `error` event and close `Stream` when accessing the underlying
|
|
|
322 |
stream resource fails with a permanent error.
|
|
|
323 |
(#52 and #40 by @clue, #25 by @lysenkobv)
|
|
|
324 |
|
|
|
325 |
* Bug fix: Do not emit empty `data` event if nothing has been read (stream reached EOF)
|
|
|
326 |
(#39 by @clue)
|
|
|
327 |
|
|
|
328 |
* Bug fix: Ignore empty writes to `Buffer`
|
|
|
329 |
(#51 by @clue)
|
|
|
330 |
|
|
|
331 |
* Add benchmarking script to measure throughput in CI
|
|
|
332 |
(#41 by @clue)
|
|
|
333 |
|
|
|
334 |
## 0.4.3 (2015-10-07)
|
|
|
335 |
|
|
|
336 |
* Bug fix: Read buffer to 0 fixes error with libevent and large quantity of I/O (@mbonneau)
|
|
|
337 |
* Bug fix: No double-write during drain call (@arnaud-lb)
|
|
|
338 |
* Bug fix: Support HHVM (@clue)
|
|
|
339 |
* Adjust compatibility to 5.3 (@clue)
|
|
|
340 |
|
|
|
341 |
## 0.4.2 (2014-09-09)
|
|
|
342 |
|
|
|
343 |
* Added DuplexStreamInterface
|
|
|
344 |
* Stream sets stream resources to non-blocking
|
|
|
345 |
* Fixed potential race condition in pipe
|
|
|
346 |
|
|
|
347 |
## 0.4.1 (2014-04-13)
|
|
|
348 |
|
|
|
349 |
* Bug fix: v0.3.4 changes merged for v0.4.1
|
|
|
350 |
|
|
|
351 |
## 0.3.4 (2014-03-30)
|
|
|
352 |
|
|
|
353 |
* Bug fix: [Stream] Fixed 100% CPU spike from non-empty write buffer on closed stream
|
|
|
354 |
|
|
|
355 |
## 0.4.0 (2014-02-02)
|
|
|
356 |
|
|
|
357 |
* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks
|
|
|
358 |
* BC break: Update to Evenement 2.0
|
|
|
359 |
* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0
|
|
|
360 |
|
|
|
361 |
## 0.3.3 (2013-07-08)
|
|
|
362 |
|
|
|
363 |
* Bug fix: [Stream] Correctly detect closed connections
|
|
|
364 |
|
|
|
365 |
## 0.3.2 (2013-05-10)
|
|
|
366 |
|
|
|
367 |
* Bug fix: [Stream] Make sure CompositeStream is closed properly
|
|
|
368 |
|
|
|
369 |
## 0.3.1 (2013-04-21)
|
|
|
370 |
|
|
|
371 |
* Bug fix: [Stream] Allow any `ReadableStreamInterface` on `BufferedSink::createPromise()`
|
|
|
372 |
|
|
|
373 |
## 0.3.0 (2013-04-14)
|
|
|
374 |
|
|
|
375 |
* Feature: [Stream] Factory method for BufferedSink
|
|
|
376 |
|
|
|
377 |
## 0.2.6 (2012-12-26)
|
|
|
378 |
|
|
|
379 |
* Version bump
|
|
|
380 |
|
|
|
381 |
## 0.2.5 (2012-11-26)
|
|
|
382 |
|
|
|
383 |
* Feature: Make BufferedSink trigger progress events on the promise (@jsor)
|
|
|
384 |
|
|
|
385 |
## 0.2.4 (2012-11-18)
|
|
|
386 |
|
|
|
387 |
* Feature: Added ThroughStream, CompositeStream, ReadableStream and WritableStream
|
|
|
388 |
* Feature: Added BufferedSink
|
|
|
389 |
|
|
|
390 |
## 0.2.3 (2012-11-14)
|
|
|
391 |
|
|
|
392 |
* Version bump
|
|
|
393 |
|
|
|
394 |
## 0.2.2 (2012-10-28)
|
|
|
395 |
|
|
|
396 |
* Version bump
|
|
|
397 |
|
|
|
398 |
## 0.2.1 (2012-10-14)
|
|
|
399 |
|
|
|
400 |
* Bug fix: Check for EOF in `Buffer::write()`
|
|
|
401 |
|
|
|
402 |
## 0.2.0 (2012-09-10)
|
|
|
403 |
|
|
|
404 |
* Version bump
|
|
|
405 |
|
|
|
406 |
## 0.1.1 (2012-07-12)
|
|
|
407 |
|
|
|
408 |
* Bug fix: Testing and functional against PHP >= 5.3.3 and <= 5.3.8
|
|
|
409 |
|
|
|
410 |
## 0.1.0 (2012-07-11)
|
|
|
411 |
|
|
|
412 |
* First tagged release
|