Diese Extension ermöglicht den transparenten Lese- und Schreibzugriff auf ZIP-komprimierte Archive und die darin enthaltenen Dateien.
Die mit PHP 4 ausgelieferte Version der Extension benötigt die ZZIPlib Bibliothek von Guido Draheim ab Version 0.10.6
Die Extension nutzt nun Funktionalität der zlib von Jean-loup Gailly und Mark Adler.
Anmerkung: Zip support before PHP 4.1.0 is experimental.
Warnung |
Because the PHP 4 zip extension is unmaintained we recommend that the PECL extension is used rather than the bundled one. |
In order to use these functions you must compile PHP with zip support
by using the --with-zip[=DIR]
configure option, where [DIR] is the prefix of the ZZIPlib library install.
Windows users need to enable php_zip.dll inside of php.ini in order to use these functions.
In order to use these functions you must compile PHP with zip support
by using the --enable-zip
configure option.
Windows users need to enable php_zip.dll inside of php.ini in order to use these functions.
Zusätzliche Informationen, wie neue Releases, Downloads Quelldateien, Maintainerinformation und ein CHANGELOG finden Sie hier: http://pecl.php.net/package/zip.
Sie können die DLL für diese PECL Erweiterung entweder von PHP Downloads oder von http://snaps.php.net/ herunterladen.
Für PHP 4 finden Sie die DLL im extensions/ Verzeichnis der PHP Windows Binärdistribution.
Diese Erweiterung definiert keine Konfigurationseinstellungen in der php.ini.
Die Zip Extension benutzt zwei Resourcetypen, einen für Verzeichnisse innerhalb eines Zip-Archivs und einen für die eigentlichen Dateieinträge innerhalb des Archivs.
Folgende Konstanten werden von dieser Erweiterung definiert und stehen nur zur Verfügung, wenn die Erweiterung entweder statisch in PHP kompiliert oder dynamisch zur Laufzeit geladen wurde.
ZipArchive uses class constants. There is three types of constants, Flags (FL_) errors (ER_) or mode (no prefix).
Create the archive if it does not exist.
Always start a new archive, this mode will overwrite the file if it already exists.
Error if archive already exists.
Perform additional consistency checks on the archive, and error if they fail.
Ignore case on name lookup
Ignore directory component
Read compressed data
Use original data, ignoring changes.
better of deflate or store.
stored (uncompressed).
shrunk
reduced with factor 1
reduced with factor 2
reduced with factor 3
reduced with factor 4
imploded
deflated
deflate64
PKWARE imploding
BZIP2 algorithm
No error.
Multi-disk zip archives not supported.
Renaming temporary file failed.
Closing zip archive failed
Seek error
Read error
Write error
CRC error
Containing zip archive was closed
No such file.
File already exists
Can't open file
Failure to create temporary file.
Zlib error
Memory allocation failure
Entry has been changed
Compression method not supported.
Premature EOF
Invalid argument
Not a zip archive
Internal error
Zip archive inconsistent
Can't remove file
Entry has been deleted
Beispiel 2. Ausgabe eines detailierten Archivlistings
|
Beispiel 3. Zip Stream Wrapper, Auslesen von OpenOffice Metainformationen
|
Das folgende Beispiel benutzt das alte PHP 4 API, es öffnet eine Zip-Datei, liest jede einzelne Datei im Archiv und gibt deren Inhalt aus. Die in diesem Beispiel genutzte test2.zip Datei ist Teil des Testarchivs des ZZIPlib Quellcodes.
Beispiel 4. Zip Beispiel
|
Zurück | Zum Anfang | Weiter |
yp_order | Nach oben | zip_close |