Snippet 0x09: Reading a ZIP/JAR file with PHP (here: a JAR manifest)
For my open source file sync software Syncany, I have integrated the automatic plugin build process (we provide plugin repository and an easy plugin API to download plugins) with an upload to the Syncany API server. Plugins (JAR files) are uploaded by Travis (example: Samba plugin) to the Syncany server. To serve meta data on through the plugin API, I need to parse the plugins’ MANIFEST.MF files and store them in a database.
This tiny blog post shows you how to read a ZIP/JAR file entry with PHP, and parse JAR manifest (MANIFEST.MF) file. That’s it. Nothing fancy.