devel:compression
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
devel:compression [2013-05-04 14:52] – created Klap-in | devel:compression [2015-08-05 19:09] (current) – removed andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Compression/ | ||
- | DokuWiki contains two classes to provide compression and extracting functions. These support gzip, bzip, tar and zip formats. | ||
- | |||
- | Please refer to the [[xref> | ||
- | |||
- | FIXME explain long pathnames in posix ustar and gnu longlink formats, | ||
- | |||
- | =====Tar archives===== | ||
- | |||
- | The [[xref> | ||
- | To keep things simple, the modification of existing archives is not supported. It handles | ||
- | uncompressed, | ||
- | |||
- | Long pathnames (>100 chars) are supported in POSIX ustar and GNU longlink formats. | ||
- | |||
- | To list the contents of an existing TAR archive, '' | ||
- | <code php> | ||
- | $tar = new Tar(); | ||
- | $tar-> | ||
- | $toc = $tar-> | ||
- | print_r($toc); | ||
- | </ | ||
- | |||
- | To extract the contents of an existing TAR archive, '' | ||
- | <code php> | ||
- | $tar = new Tar(); | ||
- | $tar-> | ||
- | $tar-> | ||
- | </ | ||
- | |||
- | To create a new TAR archive directly on the filesystem (low memory requirements), | ||
- | '' | ||
- | <code php> | ||
- | $tar = new Tar(); | ||
- | $tar-> | ||
- | $tar-> | ||
- | $tar-> | ||
- | $tar-> | ||
- | ... | ||
- | $tar-> | ||
- | </ | ||
- | |||
- | To create a TAR archive directly in memory, '' | ||
- | or '' | ||
- | <code php> | ||
- | $tar = new Tar(); | ||
- | $tar-> | ||
- | $tar-> | ||
- | $tar-> | ||
- | ... | ||
- | $tar-> | ||
- | echo $tar-> | ||
- | </ | ||
- | |||
- | ====Deprecated TarLib==== | ||
- | [[deprecated]] | ||
- | |||
- | Before the '' | ||
- | |||
- | |||
- | =====Zip archives===== | ||
- | |||
- | To list the contents of an existing ZIP archive, use '' | ||
- | <code php> | ||
- | $zip = new ZipLib(); | ||
- | $toc = $zip-> | ||
- | print_r($toc); | ||
- | </ | ||
- | |||
- | To extract the contents of an existing ZIP archive, use '' | ||
- | <code php> | ||
- | $zip = new ZipLib(); | ||
- | $ok = $zip-> | ||
- | </ | ||
- | |||
- | To create a new ZIP archive of files, '' | ||
- | <code php> | ||
- | $zip = new ZipLib(); | ||
- | $successarray = $zip-> | ||
- | $successarray = $zip-> | ||
- | ... | ||
- | echo $zip-> | ||
- | </ | ||
- | |||
- | To create a new ZIP archive of a folder, '' | ||
- | <code php> | ||
- | $zip = new ZipLib(); | ||
- | //Zips recursively the $folder directory, from the $basedir directory | ||
- | $zip-> | ||
- | ... | ||
- | echo $zip-> | ||
- | </ | ||
- | |||
- | =====Example of application===== | ||
- | The Plugin manager applies this libraries to perform the extracting of downloads. | ||
- | |||
- | See [[xref> |
devel/compression.1367671942.txt.gz · Last modified: 2013-05-04 14:52 by Klap-in