404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.145.201.49: ~ $
<?php

namespace React\Stream;

use Evenement\EventEmitter;

final class CompositeStream extends EventEmitter implements DuplexStreamInterface
{
    private $readable;
    private $writable;
    private $closed = false;

    public function __construct(ReadableStreamInterface $readable, WritableStreamInterface $writable)
    {
        $this->readable = $readable;
        $this->writable = $writable;

        if (!$readable->isReadable() || !$writable->isWritable()) {
            return $this->close();
        }

        Util::forwardEvents($this->readable, $this, array('data', 'end', 'error'));
        Util::forwardEvents($this->writable, $this, array('drain', 'error', 'pipe'));

        $this->readable->on('close', array($this, 'close'));
        $this->writable->on('close', array($this, 'close'));
    }

    public function isReadable()
    {
        return $this->readable->isReadable();
    }

    public function pause()
    {
        $this->readable->pause();
    }

    public function resume()
    {
        if (!$this->writable->isWritable()) {
            return;
        }

        $this->readable->resume();
    }

    public function pipe(WritableStreamInterface $dest, array $options = array())
    {
        return Util::pipe($this, $dest, $options);
    }

    public function isWritable()
    {
        return $this->writable->isWritable();
    }

    public function write($data)
    {
        return $this->writable->write($data);
    }

    public function end($data = null)
    {
        $this->readable->pause();
        $this->writable->end($data);
    }

    public function close()
    {
        if ($this->closed) {
            return;
        }

        $this->closed = true;
        $this->readable->close();
        $this->writable->close();

        $this->emit('close');
        $this->removeAllListeners();
    }
}

Filemanager

Name Type Size Permission Actions
CompositeStream.php File 1.82 KB 0644
DuplexResourceStream.php File 6.6 KB 0644
DuplexStreamInterface.php File 1.68 KB 0644
ReadableResourceStream.php File 5.53 KB 0644
ReadableStreamInterface.php File 13.9 KB 0644
ThroughStream.php File 4.81 KB 0644
Util.php File 2.23 KB 0644
WritableResourceStream.php File 5.3 KB 0644
WritableStreamInterface.php File 14.4 KB 0644