How do ZIP, GZIP and TAR work without shell tools?

Archive modules use PHP extensions and guarded extraction rules.

ZIP and GZIP

zip uses ZipArchive for ZIP containers and PHP gzip functions for single-file GZIP data. If ZipArchive is unavailable, the command reports that capability honestly.

TAR

tar uses PHP archive facilities for uncompressed TAR without invoking Unix tar.

Extraction safety

Both modules reject absolute paths, traversal components and unsafe links before writing extracted entries. Source deletion occurs only after a successful result and requires del.

Examples

install zip
install tar
zip sandbox/data sandbox/tmp/data.zip
tar sandbox/data sandbox/tmp/data.tar

Related documentation

← Back to FAQ