Skip to content

Instantly share code, notes, and snippets.

@hakre
Created October 4, 2013 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakre/6824543 to your computer and use it in GitHub Desktop.
Save hakre/6824543 to your computer and use it in GitHub Desktop.

PHP Zip extension resources types

@TODO add this to the PHP manual

PHP has two resource types related to the PHP Zip Extension:

  1. Zip Directory
  2. Zip Entry

Both are not a "stream" resource (if tested with stream_get_meta_data).

The "Zip Directory" resource type in PHP

The function zip_open returns - if successful - a resource of type "Zip Directory".

It represents the listing of entries (filenames) in a zip-file.

The "Zip Entry" resource type in PHP

The function zip_read returns - if successful - a resource of type "Zip Entry".

It represents an entry (filename) in a zip-file represented by a resource of type "Zip Directory".

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