library/Rediska/Connection.php
public function write($string)
    {
        if ($string !== '') {
            $needToWrite = (string) $string . Rediska::EOL;

            $this->connect();

            while ($needToWrite) {
                $bytes = @fwrite($this->_socket, $needToWrite);

                if ($bytes === false) {
                    $this->disconnect();
                    throw new Rediska_Connection_Exception("Can't write to socket.");
                }

                if ($bytes == 0) {
                    return true;
                }

                $needToWrite = substr($needToWrite, $bytes);
            }

            return true;
        } else {
            return false;
        }
    }
public function write($string)
    {
        if ($string !== '') {
            $needToWrite = (string) $string . Rediska::EOL;

            $this->connect();

            while ($needToWrite) {
                $bytes = @fwrite($this->_socket, $needToWrite);

                if ($bytes === false) {
                    $this->disconnect();
                    throw new Rediska_Connection_Exception("Can't write to socket.");
                }

                if ($bytes == 0) {
                    return true;
                }

                $needToWrite = substr($needToWrite, $bytes);
            }

            return true;
        } else {
            return false;
        }
    }
Write to connection stream

@param $string
@return boolean