I require a pure PHP implementation of an archiving solution that is cross platform and supports windows, linux, and mac. It must create archives that can also be read using standard archive utility applications on desktops (winrar, winzip, 7zip, etc.). Right now ZipArchive/Phar are available solutions for PHP that are bundled into our current software as with interfaces/wrappers leveraging these but we have additional requirements that aren't covered. Not all hosts support required extensions/libraries especially for compression and ZipArchive may not even be available.
We need an enhancement to pclzip that can meet our use cases and easily integrate into our code base as a library file or file(s).
The code needs to be namespaced and support several features,
- Lowest common demonitor = shared hosting environment
- memory limit, max execution time limit, etc.
- Run from command line or web request (ie server timeout issues)
- Archive of many files and large files, takes more then one 30 second web request
- Support checkpointing, so if web request times out we can resume on subsequent request where we left off
- Need a way to identify where we left off at and resume from there
- Optimized, fast, and efficient
- Code needs to be benchmarked, profiled, and optimized
- Support zip, tar/gzip, and JPA (no checksums unlike zip)
- JPA can be viewed as optimal for limited enironments like shared hosting
- Support iterators in php
- build from iterator like phar as an example
- Support multi-part archives
- no current solution makes it possible to do multi-zip archives, using Zip Archive for example this would have to be done manually
- Support password protected archives (if too complicated not necessary)
- Support adding comments/additional files to archive (ie embed an installer on top of user requested archive
- ie We may bundle additional files to allow additional processing once unzipped whether from command line or our software
See open source pclzip:
[url removed, login to view]
Additionally we will want to add support for league/flysystem [url removed, login to view] to easily support the common API that is widely used in the open source community.
There should be minimal files and model off existing PHAR/Ziparchive php implementations as far as methods/design goes but also much code can be sampled from the pclzip.
If you are an expert in this area and have comments/suggestions please let us know if our solution can be made even better and we missed something.
We are on the fence about open sourcing and adding this to GIT/GitHub or storing this with our software, but if you feel strongly about it and would like your work to be open source licensed we can discuss it.