public function get($fid, $ext = null) {
        $volume = $this->lookup($fid);

        if (!$volume) {
            return null;
        }

        $path = $fid;

        if ($ext) {
            $path = $path . '.' . $ext;
        }

        $res = $this->client->get($this->buildVolumeUrl($volume->getPublicUrl(), $path));

        if ($res->getStatusCode() != 200) {
            throw new SeaweedFSException('Unexpected response when retrieving file: ' . $res->getStatusCode());
        }

        return $res->getBody()->detach();
    }
public function get($fid, $ext = null) {
        $volume = $this->lookup($fid);

        if (!$volume) {
            return null;
        }

        $path = $fid;

        if ($ext) {
            $path = $path . '.' . $ext;
        }

        $res = $this->client->get($this->buildVolumeUrl($volume->getPublicUrl(), $path));

        if ($res->getStatusCode() != 200) {
            throw new SeaweedFSException('Unexpected response when retrieving file: ' . $res->getStatusCode());
        }

        return $res->getBody()->detach();
    }
public function get ( $ fid , $ ext = null ) { $ volume = $ this -> lookup ( $ fid ) ; if ( ! $ volume ) { return null ; } $ path = $ fid ; if ( $ ext ) { $ path = $ path . '.' . $ ext ; } $ res = $ this -> client -> get ( $ this -> buildVolumeUrl ( $ volume -> getPublicUrl ( ) , $ path ) ) ; if ( $ res -> getStatusCode ( ) != 200 ) { throw new SeaweedFSException ( 'Unexpected response when retrieving file: ' . $ res -> getStatusCode ( ) ) ; } return $ res -> getBody ( ) -> detach ( ) ; }
Fetch a file from a volume.

@param $fid
@param null $ext
@return resource
@throws SeaweedFSException
Fetch a file from a volume .