Skip to content

Get a stream without printing it immediately #45

Description

@Rudloff

Hello,

I'm trying to get a Zip stream that I can manipulate.
I can't use ZipStream because it prints the stream instead of returning it.

I tried to use Zip::getZipFile() but it seems to close the stream as soon as I return it:

function getZipStream()
{
    $zip = new \PHPZip\Zip\File\Zip();
    $zip->addFile('foo', 'foo');
    $stream = $zip->getZipFile();
    var_dump(is_resource($stream)); //bool(true)
    return $stream;
}

var_dump(is_resource(getZipStream())); //bool(false)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions