src/Connection/StreamConnection.php
protected function write($buffer)
    {
        $socket = $this->getResource();

        while (($length = strlen($buffer)) > 0) {
            $written = @fwrite($socket, $buffer);

            if ($length === $written) {
                return;
            }

            if ($written === false || $written === 0) {
                $this->onConnectionError('Error while writing bytes to the server.');
            }

            $buffer = substr($buffer, $written);
        }
    }
protected function write($buffer)
    {
        $socket = $this->getResource();

        while (($length = strlen($buffer)) > 0) {
            $written = @fwrite($socket, $buffer);

            if ($length === $written) {
                return;
            }

            if ($written === false || $written === 0) {
                $this->onConnectionError('Error while writing bytes to the server.');
            }

            $buffer = substr($buffer, $written);
        }
    }
protected function write ( $ buffer ) { $ socket = $ this -> getResource ( ) ; while ( ( $ length = strlen ( $ buffer ) ) > 0 ) { $ written = @ fwrite ( $ socket , $ buffer ) ; if ( $ length === $ written ) { return ; } if ( $ written === false || $ written === 0 ) { $ this -> onConnectionError ( 'Error while writing bytes to the server.' ) ; } $ buffer = substr ( $ buffer , $ written ) ; } }
Performs a write operation over the stream of the buffer containing a
command serialized with the Redis wire protocol.

@param string $buffer Representation of a command in the Redis wire protocol.
Performs a write operation over the stream of the buffer containing a command serialized with the Redis wire protocol .