public function read($length, $offset = null, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!$this->fd) {
            if ($cb) {
                $cb($this, false);
            }
            return false;
        }
        if (!FileSystem::$supported) {
            if ($offset !== null) {
                fseek($this->fd, $length);
            }
            $data = fread($this->fd, $length);
            $cb === null || $cb($this, $data);
            return $data;
        }
        $this->offset += $length;
        eio_read(
            $this->fd,
            $length,
            $offset !== null ? $offset : $this->offset,
            $pri,
            $cb,
            $this
        );
        return true;
    }
public function read($length, $offset = null, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!$this->fd) {
            if ($cb) {
                $cb($this, false);
            }
            return false;
        }
        if (!FileSystem::$supported) {
            if ($offset !== null) {
                fseek($this->fd, $length);
            }
            $data = fread($this->fd, $length);
            $cb === null || $cb($this, $data);
            return $data;
        }
        $this->offset += $length;
        eio_read(
            $this->fd,
            $length,
            $offset !== null ? $offset : $this->offset,
            $pri,
            $cb,
            $this
        );
        return true;
    }
public function read ( $ length , $ offset = null , $ cb = null , $ pri = EIO_PRI_DEFAULT ) { $ cb = CallbackWrapper :: forceWrap ( $ cb ) ; if ( ! $ this -> fd ) { if ( $ cb ) { $ cb ( $ this , false ) ; } return false ; } if ( ! FileSystem :: $ supported ) { if ( $ offset !== null ) { fseek ( $ this -> fd , $ length ) ; } $ data = fread ( $ this -> fd , $ length ) ; $ cb === null || $ cb ( $ this , $ data ) ; return $ data ; } $ this -> offset += $ length ; eio_read ( $ this -> fd , $ length , $ offset !== null ? $ offset : $ this -> offset , $ pri , $ cb , $ this ) ; return true ; }
Reads data from file
@param  integer $length Length
@param  integer $offset Offset
@param  callable $cb Callback
@param  integer $pri Priority
@return boolean
Reads data from file