1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

Move from React 0.4.0 to 0.3.4 for PHP 5.3 compatibility reasons

This commit is contained in:
Afterster 2014-04-13 08:58:34 +02:00
parent d3f01a3bc7
commit 7f82bea13e
50 changed files with 608 additions and 1937 deletions

View file

@ -21,13 +21,15 @@ class Stream extends EventEmitter implements ReadableStreamInterface, WritableSt
$this->loop = $loop;
$this->buffer = new Buffer($this->stream, $this->loop);
$this->buffer->on('error', function ($error) {
$this->emit('error', array($error, $this));
$this->close();
$that = $this;
$this->buffer->on('error', function ($error) use ($that) {
$that->emit('error', array($error, $that));
$that->close();
});
$this->buffer->on('drain', function () {
$this->emit('drain', array($this));
$this->buffer->on('drain', function () use ($that) {
$that->emit('drain');
});
$this->resume();
@ -93,8 +95,10 @@ class Stream extends EventEmitter implements ReadableStreamInterface, WritableSt
$this->readable = false;
$this->writable = false;
$this->buffer->on('close', function () {
$this->close();
$that = $this;
$this->buffer->on('close', function () use ($that) {
$that->close();
});
$this->buffer->end($data);