Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ziparchive(3) [php man page]

ZIPARCHIVE(3)								 1							     ZIPARCHIVE(3)

The ZipArchive class

INTRODUCTION
A file archive, compressed with Zip. CLASS SYNOPSIS
ZipArchive ZipArchive Properties o int$status o int$statusSys o int$numFiles o string$filename o string$comment Methods o bool ZipArchive::addEmptyDir (string $dirname) o bool ZipArchive::addFile NULL (string $filename, [string $localname], [int $start], [int $length]) o bool ZipArchive::addFromString (string $localname, string $contents) o bool ZipArchive::addGlob (string $pattern, [int $flags], [array $options = array()]) o bool ZipArchive::addPattern (string $pattern, [string $path = "."], [array $options = array()]) o bool ZipArchive::close (void ) o bool ZipArchive::deleteIndex (int $index) o bool ZipArchive::deleteName (string $name) o bool ZipArchive::extractTo (string $destination, [mixed $entries]) o string ZipArchive::getArchiveComment ([int $flags]) o string ZipArchive::getCommentIndex (int $index, [int $flags]) o string ZipArchive::getCommentName (string $name, [int $flags]) o bool ZipArchive::GetExternalAttributesIndex (int $index, int &$opsys, int &$attr, [int $flags]) o bool ZipArchive::getExternalAttributesName (string $name, int &$opsys, int &$attr, [int $flags]) o string ZipArchive::getFromIndex (int $index, [int $length], [int $flags]) o string ZipArchive::getFromName (string $name, [int $length], [int $flags]) o string ZipArchive::getNameIndex (int $index, [int $flags]) o string ZipArchive::getStatusString (void ) o resource ZipArchive::getStream (string $name) o int ZipArchive::locateName (string $name, [int $flags]) o mixed ZipArchive::open (string $filename, [int $flags]) o bool ZipArchive::renameIndex (int $index, string $newname) o bool ZipArchive::renameName (string $name, string $newname) o bool ZipArchive::setArchiveComment (string $comment) o bool ZipArchive::setCommentIndex (int $index, string $comment) o bool ZipArchive::setCommentName (string $name, string $comment) o bool ZipArchive::setExternalAttributesIndex (int $index, int $opsys, int $attr, [int $flags]) o bool ZipArchive::setExternalAttributesName (string $name, int $opsys, int $attr, [int $flags]) o public bool ZipArchive::setPassword (string $password) o array ZipArchive::statIndex (int $index, [int $flags]) o array ZipArchive::statName (string $name, [int $flags]) o bool ZipArchive::unchangeAll (void ) o bool ZipArchive::unchangeArchive (void ) o bool ZipArchive::unchangeIndex (int $index) o bool ZipArchive::unchangeName (string $name) PROPERTIES
o $status -Status of the Zip Archive o $statusSys -System status of the Zip Archive o $numFiles -Number of files in archive o $filename -File name in the file system o $comment -Comment for the archive PHP Documentation Group ZIPARCHIVE(3)

Check Out this Related Man Page

PHARDATA.EXTRACTTO(3)							 1						     PHARDATA.EXTRACTTO(3)

PharData::extractTo - Extract the contents of a tar/zip archive to a directory

SYNOPSIS
bool PharData::extractTo (string $pathto, [string|array $files], [bool $overwrite = false]) DESCRIPTION
Extract all files within a tar/zip archive to disk. Extracted files and directories preserve permissions as stored in the archive. The optional parameters allow optional control over which files are extracted, and whether existing files on disk can be overwritten. The sec- ond parameter files can be either the name of a file or directory to extract, or an array of names of files and directories to extract. By default, this method will not overwrite existing files, the third parameter can be set to true to enable overwriting of files. This method is similar to ZipArchive.extractTo(3). PARAMETERS
o $pathto - Path to extract the given files to o $files - The name of a file or directory to extract, or an array of files/directories to extract o $overwrite - Set to TRUE to enable overwriting existing files RETURN VALUES
returns TRUE on success, but it is better to check for thrown exception, and assume success if none is thrown. ERRORS
/EXCEPTIONS Throws PharException if errors occur while flushing changes to disk. EXAMPLES
Example #1 A PharData.extractTo(3) example <?php try { $phar = new PharData('myphar.tar'); $phar->extractTo('/full/path'); // extract all files $phar->extractTo('/another/path', 'file.txt'); // extract only file.txt $phar->extractTo('/this/path', array('file1.txt', 'file2.txt')); // extract 2 files only $phar->extractTo('/third/path', null, true); // extract all files, and overwrite } catch (Exception $e) { // handle errors } ?> SEE ALSO
Phar.extractTo(3). PHP Documentation Group PHARDATA.EXTRACTTO(3)
Man Page