public function readLine()
    {
        if (!$this->isConnected()) {
            throw new Rediska_Connection_Exception("Can't read without connection to Redis server. Do connect or write first.");
        }

        $reply = @fgets($this->_socket);
        
        if ($reply === false || $reply === '') {
            $metaData = stream_get_meta_data($this->_socket);
            if ($metaData['timed_out']) {
                throw new Rediska_Connection_TimeoutException("Connection read timed out.");
            }

            if ($this->_options['blockingMode'] && !$metaData['eof']) {
                $this->disconnect();
                throw new Rediska_Connection_Exception("Can't read from socket.");
            }

            $reply = null;
        } else {
            $reply = trim($reply);
        }

        return $reply;
    }
public function readLine()
    {
        if (!$this->isConnected()) {
            throw new Rediska_Connection_Exception("Can't read without connection to Redis server. Do connect or write first.");
        }

        $reply = @fgets($this->_socket);
        
        if ($reply === false || $reply === '') {
            $metaData = stream_get_meta_data($this->_socket);
            if ($metaData['timed_out']) {
                throw new Rediska_Connection_TimeoutException("Connection read timed out.");
            }

            if ($this->_options['blockingMode'] && !$metaData['eof']) {
                $this->disconnect();
                throw new Rediska_Connection_Exception("Can't read from socket.");
            }

            $reply = null;
        } else {
            $reply = trim($reply);
        }

        return $reply;
    }
public function readLine ( ) { if ( ! $ this -> isConnected ( ) ) { throw new Rediska_Connection_Exception ( "Can't read without connection to Redis server. Do connect or write first." ) ; } $ reply = @ fgets ( $ this -> _socket ) ; if ( $ reply === false || $ reply === '' ) { $ metaData = stream_get_meta_data ( $ this -> _socket ) ; if ( $ metaData [ 'timed_out' ] ) { throw new Rediska_Connection_TimeoutException ( "Connection read timed out." ) ; } if ( $ this -> _options [ 'blockingMode' ] && ! $ metaData [ 'eof' ] ) { $ this -> disconnect ( ) ; throw new Rediska_Connection_Exception ( "Can't read from socket." ) ; } $ reply = null ; } else { $ reply = trim ( $ reply ) ; } return $ reply ; }
Read line from connection stream

@throws Rediska_Connection_Exception
@throws Rediska_Connection_TimeoutException
@return string
Read line from connection stream