PHPZip\Zip\File\Zip::getZipData PHP Method

getZipData() public method

Get the zip file contents If the zip haven't been finalized yet, this will cause it to become finalized
Author: A. Grandt ([email protected])
Author: Greg Kappatos
public getZipData ( ) : string
return string zip data
    public function getZipData() {
        $result = null;

        if (!$this->isFinalized) {
            $this->finalize();
        }

        if (!is_resource($this->_zipFile)) {
            $result = $this->_zipData;
        } else {
            rewind($this->_zipFile);
            $stat   = fstat($this->_zipFile);
            $result = fread($this->_zipFile, $stat['size']);
        }

        return $result;
    }