diff --git a/reference/zip/book.xml b/reference/zip/book.xml index 0fb6bb5be8..b6e222a238 100644 --- a/reference/zip/book.xml +++ b/reference/zip/book.xml @@ -1,5 +1,5 @@ - + @@ -19,6 +19,7 @@ &reference.zip.setup; &reference.zip.constants; &reference.zip.examples; + &reference.zip.ziparchive; &reference.zip.reference; diff --git a/reference/zip/constants.xml b/reference/zip/constants.xml index 1123b84f45..885b8ac538 100644 --- a/reference/zip/constants.xml +++ b/reference/zip/constants.xml @@ -1,12 +1,15 @@ - + &reftitle.constants; &extension.constants; - ZipArchive uses class constants. There is three types of constants, - Flags (FL_) errors (ER_) or mode (no prefix). + ZipArchive uses class constants. + There are three types of constants : + Flags (prefixed with FL_), + errors (prefixed with ER_) and + mode (no prefix). diff --git a/reference/zip/ziparchive.xml b/reference/zip/ziparchive.xml new file mode 100644 index 0000000000..fafbf3e49f --- /dev/null +++ b/reference/zip/ziparchive.xml @@ -0,0 +1,107 @@ + + + + The <classname>ZipArchive</classname> class + ZipArchive + + + + +
+ &reftitle.intro; + + A file archive, compressed with Zip. + +
+ + +
+ &reftitle.classsynopsis; + + + + ZipArchive + + + + + ZipArchive + + + + Properties + + + Methods + + + + + +
+
+ + +
+ &reftitle.properties; + + + status + + Status of the Zip Archive + + + + statusSys + + System status of the Zip Archive + + + + numFiles + + Number of files in archive + + + + filename + + File name in the file system + + + + comment + + Comment for the archive + + + +
+ + + &reference.zip.entities.ziparchive; + + +
+ + + diff --git a/reference/zip/ziparchive/addemptydir.xml b/reference/zip/ziparchive/addemptydir.xml new file mode 100644 index 0000000000..7b5395a2ef --- /dev/null +++ b/reference/zip/ziparchive/addemptydir.xml @@ -0,0 +1,87 @@ + + + + + ZipArchive::addEmptyDir + Add a new directory + + + &reftitle.description; + + boolZipArchive::addEmptyDir + stringdirname + + + Adds an empty directory in the archive. + + + + + &reftitle.parameters; + + + + dirname + + + The directory to add. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + Create a new directory in an archive + +open('test.zip') === TRUE) { + if($zip->addEmptyDir('newDirectory')) { + echo 'Created a new root directory'; + } else { + echo 'Could not create the directory'; + } + $zip->close(); +} else { + echo 'failed'; +} +?> +]]> + + + + + + + diff --git a/reference/zip/ziparchive/addfile.xml b/reference/zip/ziparchive/addfile.xml new file mode 100644 index 0000000000..dff7d55203 --- /dev/null +++ b/reference/zip/ziparchive/addfile.xml @@ -0,0 +1,95 @@ + + + + + ZipArchive::addFile + Adds a file to a ZIP archive from the given path + + + &reftitle.description; + + boolZipArchive::addFile + stringfilename + stringlocalname + + + Adds a file to a ZIP archive from a given path + + + + &reftitle.parameters; + + + + filename + + + The path to the file to add. + + + + + localname + + + local name inside ZIP archive. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + This example opens a ZIP file archive + test.zip and add + the file /path/to/index.txt. + as newname.txt. + + + Open and extract + +open('test.zip') === TRUE) { + $zip->addFile('/path/to/index.txt', 'newname.txt'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/addfromstring.xml b/reference/zip/ziparchive/addfromstring.xml new file mode 100644 index 0000000000..379b900db0 --- /dev/null +++ b/reference/zip/ziparchive/addfromstring.xml @@ -0,0 +1,108 @@ + + + + + ZipArchive::addFromString + Add a file to a ZIP archive using its contents + + + &reftitle.description; + + boolZipArchive::addFromString + stringlocalname + stringcontents + + + Add a file to a ZIP archive using its contents. + + + + &reftitle.parameters; + + + + localname + + + The name of the entry to create. + + + + + contents + + + The contents to use to create the entry. It is used in a binary + safe mode. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Add an entry to a new archive + +open('test.zip', ZipArchive::CREATE); +if ($res === TRUE) { + $zip->addFromString('test.txt', 'file content goes here'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + Add file to a directory inside an archive + +open('test.zip') === TRUE) { + $zip->addFromString('dir/test.txt', 'file content goes here'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/close.xml b/reference/zip/ziparchive/close.xml new file mode 100644 index 0000000000..fae98054b6 --- /dev/null +++ b/reference/zip/ziparchive/close.xml @@ -0,0 +1,46 @@ + + + + + ZipArchive::close + Close the active archive (opened or newly created) + + + &reftitle.description; + + boolZipArchive::close + + + + Close opened or created archive and save changes. This method is + automatically called at the end of the script. + + + + &reftitle.returnvalues; + + &return.success; + + + + + diff --git a/reference/zip/ziparchive/deleteindex.xml b/reference/zip/ziparchive/deleteindex.xml new file mode 100644 index 0000000000..b87d35c851 --- /dev/null +++ b/reference/zip/ziparchive/deleteindex.xml @@ -0,0 +1,80 @@ + + + + + ZipArchive::deleteIndex + delete an entry in the archive using its index + + + &reftitle.description; + + boolZipArchive::deleteIndex + intindex + + + Delete an entry in the archive using its index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry to delete. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Delete file from archive using its index + +open('test.zip') === TRUE) { + $zip->deleteIndex(2); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/deletename.xml b/reference/zip/ziparchive/deletename.xml new file mode 100644 index 0000000000..bd2fcbf54f --- /dev/null +++ b/reference/zip/ziparchive/deletename.xml @@ -0,0 +1,80 @@ + + + + + ZipArchive::deleteName + delete an entry in the archive using its name + + + &reftitle.description; + + boolZipArchive::deleteName + stringname + + + Delete an entry in the archive using its name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry to delete. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Delete file from archive using its name + +open('test1.zip') === TRUE) { + $zip->deleteName('testfromfile.php'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/extractto.xml b/reference/zip/ziparchive/extractto.xml new file mode 100644 index 0000000000..07c7b4afe3 --- /dev/null +++ b/reference/zip/ziparchive/extractto.xml @@ -0,0 +1,115 @@ + + + + + ZipArchive::extractTo + Extract the archive contents + + + &reftitle.description; + + boolZipArchive::extractTo + stringdestination + mixedentries + + + Extract the complete archive or the given files to the specified + destination. + + + + &reftitle.parameters; + + + + destination + + + Location where to extract the files. + + + + + entries + + + The entries to extract. It accepts either a single entry name or + an array of names. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + This example opens a ZIP file archive, reads each file in the + archive and prints out its contents. The + test2.zip archive used in this example is + one of the test archives in the ZZIPlib source distribution. + + + Extract all entries + +open('test.zip') === TRUE) { + $zip->extractTo('/my/destination/dir/'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + Extract only two entries + +open('test_im.zip'); +if ($res === TRUE) { + $zip->extractTo('/my/destination/dir/', array('pear_item.gif', 'testfromfile.php')); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/getarchivecomment.xml b/reference/zip/ziparchive/getarchivecomment.xml new file mode 100644 index 0000000000..b372bcf4a6 --- /dev/null +++ b/reference/zip/ziparchive/getarchivecomment.xml @@ -0,0 +1,66 @@ + + + + + ZipArchive::getArchiveComment + Returns the Zip archive comment + + + &reftitle.description; + + stringZipArchive::getArchiveComment + + + + Returns the Zip archive comment. + + + + &reftitle.returnvalues; + + Returns the Zip archive comment or &false; on failure. + + + + &reftitle.examples; + + Dump an archive comment + +open('test_with_comment.zip'); +if ($res === TRUE) { + var_dump($zip->getArchiveComment()); + /* Or using the archive property */ + var_dump($zip->comment); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/getcommentindex.xml b/reference/zip/ziparchive/getcommentindex.xml new file mode 100644 index 0000000000..b92c184742 --- /dev/null +++ b/reference/zip/ziparchive/getcommentindex.xml @@ -0,0 +1,89 @@ + + + + + ZipArchive::getCommentIndex + Returns the comment of an entry using the entry index + + + &reftitle.description; + + stringZipArchive::getCommentIndex + intindex + intflags + + + Returns the comment of an entry using the entry index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry + + + + + flags + + + If flags is set to ZIPARCHIVE::FL_UNCHANGED, the original unchanged + comment is returned. + + + + + + + + &reftitle.returnvalues; + + Returns the comment on success or &false; on failure. + + + + &reftitle.examples; + + Dump an entry comment + +open('test1.zip'); +if ($res === TRUE) { + var_dump($zip->getCommentIndex(1)); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/getcommentname.xml b/reference/zip/ziparchive/getcommentname.xml new file mode 100644 index 0000000000..e5007711d8 --- /dev/null +++ b/reference/zip/ziparchive/getcommentname.xml @@ -0,0 +1,89 @@ + + + + + ZipArchive::getCommentName + Returns the comment of an entry using the entry name + + + &reftitle.description; + + stringZipArchive::getCommentName + stringname + intflags + + + Returns the comment of an entry using the entry name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry + + + + + flags + + + If flags is set to ZIPARCHIVE::FL_UNCHANGED, the original unchanged + comment is returned. + + + + + + + + &reftitle.returnvalues; + + Returns the comment on success or &false; on failure. + + + + &reftitle.examples; + + Dump an entry comment + +open('test1.zip'); +if ($res === TRUE) { + var_dump($zip->getCommentName('test/entry1.txt')); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/getfromindex.xml b/reference/zip/ziparchive/getfromindex.xml new file mode 100644 index 0000000000..80820c0183 --- /dev/null +++ b/reference/zip/ziparchive/getfromindex.xml @@ -0,0 +1,101 @@ + + + + + ZipArchive::getFromIndex + Returns the entry contents using its index. + + + &reftitle.description; + + mixedZipArchive::getFromIndex + intindex + intflags + + + Returns the entry contents using its index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry + + + + + flags + + + The flags to use to open the archive. the following values may + be ORed to it. + + + + ZIPARCHIVE::FL_UNCHANGED + + + + + ZIPARCHIVE::FL_COMPRESSED + + + + + + + + + + + &reftitle.returnvalues; + + Returns the contents of the entry on success or &false; on failure. + + + + &reftitle.examples; + + Get the file contents + +open('test.zip') === TRUE) { + echo $zip->getFromIndex(2); + $zip->close(); +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/getfromname.xml b/reference/zip/ziparchive/getfromname.xml new file mode 100644 index 0000000000..ffe7ea9693 --- /dev/null +++ b/reference/zip/ziparchive/getfromname.xml @@ -0,0 +1,116 @@ + + + + + ZipArchive::getFromName + Returns the entry contents using its name. + + + &reftitle.description; + + mixedZipArchive::getFromName + stringname + intflags + + + Returns the entry contents using its name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry + + + + + flags + + + The flags to use to open the archive. the following values may + be ORed to it. + + + + ZIPARCHIVE::FL_UNCHANGED + + + + + ZIPARCHIVE::FL_COMPRESSED + + + + + + + + + + + &reftitle.returnvalues; + + Returns the contents of the entry on success or &false; on failure. + + + + &reftitle.examples; + + Get the file contents + +open('test1.zip') === TRUE) { + echo $zip->getFromName('testfromfile.php'); + $zip->close(); +} else { + echo 'failed'; +} +?> +]]> + + + + Convert an image from a zip entry + +open(dirname(__FILE__) . '/test_im.zip')) { + $im_string = $z->getFromName("pear_item.gif"); + $im = imagecreatefromstring($im_string); + imagepng($im, 'b.png'); +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/getnameindex.xml b/reference/zip/ziparchive/getnameindex.xml new file mode 100644 index 0000000000..f6b777c999 --- /dev/null +++ b/reference/zip/ziparchive/getnameindex.xml @@ -0,0 +1,60 @@ + + + + + ZipArchive::getNameIndex + Returns the name of an entry using its index + + + &reftitle.description; + + stringZipArchive::getNameIndex + intindex + + + Returns the name of an entry using its index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry. + + + + + + + + &reftitle.returnvalues; + + Returns the name on success or &false; on failure. + + + + + diff --git a/reference/zip/ziparchive/getstream.xml b/reference/zip/ziparchive/getstream.xml new file mode 100644 index 0000000000..2d8f31a90b --- /dev/null +++ b/reference/zip/ziparchive/getstream.xml @@ -0,0 +1,119 @@ + + + + + ZipArchive::getStream + Get a file handler to the entry defined by its name (read only). + + + &reftitle.description; + + resourceZipArchive::getStream + stringname + + + Get a file handler to the entry defined by its name. For now it only + supports read operations. + + + + &reftitle.parameters; + + + + name + + + The name of the entry to use. + + + + + + + + &reftitle.returnvalues; + + Returns a file pointer (resource) on success or &false; on failure. + + + + &reftitle.examples; + + Get the entry contents with <function>fread</function> and store it + +open('test.zip')) { + $fp = $z->getStream('test'); + if(!$fp) exit("failed\n"); + + while (!feof($fp)) { + $contents .= fread($fp, 2); + } + + fclose($fp); + file_put_contents('t',$contents); + echo "done.\n"; +} +?> +]]> + + + + Same as the previous example but with <function>fopen</function> and the zip + stream wrapper + + +]]> + + + + Stream wrapper and image, can be used with the xml function + as well + + +]]> + + + + + + diff --git a/reference/zip/ziparchive/locatename.xml b/reference/zip/ziparchive/locatename.xml new file mode 100644 index 0000000000..5afc8ee28e --- /dev/null +++ b/reference/zip/ziparchive/locatename.xml @@ -0,0 +1,129 @@ + + + + + ZipArchive::locateName + Returns the index of the entry in the archive + + + &reftitle.description; + + mixedZipArchive::locateName + stringname + intflags + + + Locates an entry using its name. + + + + &reftitle.parameters; + + + + name + + + The name of the entry to look up + + + + + flags + + + The flags are specified by ORing the following values, + or 0 for none of them. + + + + ZIPARCHIVE::FL_NOCASE + + + + + ZIPARCHIVE::FL_NODIR + + + + + + + + + + + &reftitle.returnvalues; + + Returns the index of the entry on success or &false; on failure. + + + + &reftitle.examples; + + Create an archive and then use it with <function>ZipArchive::locateName</function> + +open($file, ZIPARCHIVE::CREATE) !== TRUE) { + exit('failed'); +} + +$zip->addFromString('entry1.txt', 'entry #1'); +$zip->addFromString('entry2.txt', 'entry #2'); +$zip->addFromString('dir/entry2d.txt', 'entry #2'); + +if (!$zip->status == ZIPARCHIVE::ER_OK) { + echo "failed to write zip\n"; +} +$zip->close(); + +if ($zip->open($file) !== TRUE) { + exit('failed'); +} + +echo $zip->locateName('entry1.txt') . "\n"; +echo $zip->locateName('eNtry2.txt') . "\n"; +echo $zip->locateName('eNtry2.txt', ZIPARCHIVE::FL_NOCASE) . "\n"; +echo $zip->locateName('enTRy2d.txt', ZIPARCHIVE::FL_NOCASE|ZIPARCHIVE::FL_NODIR) . "\n"; +$zip->close(); + +?> +]]> + + + &example.outputs; + + + + + + + diff --git a/reference/zip/ziparchive/open.xml b/reference/zip/ziparchive/open.xml new file mode 100644 index 0000000000..353b02164a --- /dev/null +++ b/reference/zip/ziparchive/open.xml @@ -0,0 +1,193 @@ + + + + + ZipArchive::open + Open a ZIP file archive + + + &reftitle.description; + + mixedZipArchive::open + stringfilename + intflags + + + Opens a new zip archive for reading, writing or modifying. + + + + &reftitle.parameters; + + + + filename + + + The file name of the ZIP archive to open. + + + + + flags + + + The mode to use to open the archive. + + + + ZIPARCHIVE::OVERWRITE + + + + + ZIPARCHIVE::CREATE + + + + + ZIPARCHIVE::EXCL + + + + + ZIPARCHIVE::CHECKCONS + + + + + + + + + + + &reftitle.returnvalues; + + + + Error codes + + + Returns &true; on success or the error code. + + + + ZIPARCHIVE::ER_EXISTS + + + + + ZIPARCHIVE::ER_INCONS + + + + + ZIPARCHIVE::ER_INVAL + + + + + ZIPARCHIVE::ER_MEMORY + + + + + ZIPARCHIVE::ER_NOENT + + + + + ZIPARCHIVE::ER_NOZIP + + + + + ZIPARCHIVE::ER_OPEN + + + + + ZIPARCHIVE::ER_READ + + + + + ZIPARCHIVE::ER_SEEK + + + + + + + + + + + &reftitle.examples; + + This example opens a ZIP file archive, reads each file in the + archive and prints out its contents. The + test2.zip archive used in this example is + one of the test archives in the ZZIPlib source distribution. + + + Open and extract + +open('test.zip'); +if ($res === TRUE) { + echo 'ok'; + $zip->extractTo('test'); + $zip->close(); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + + + Create an archive + +open('test.zip', ZipArchive::CREATE); +if ($res === TRUE) { + $zip->addFromString('test.txt', 'file content goes here'); + $zip->addFile('data.txt', 'entryname.txt'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/renameindex.xml b/reference/zip/ziparchive/renameindex.xml new file mode 100644 index 0000000000..0ec720c7db --- /dev/null +++ b/reference/zip/ziparchive/renameindex.xml @@ -0,0 +1,89 @@ + + + + + ZipArchive::renameIndex + Renames an entry defined by its index + + + &reftitle.description; + + boolZipArchive::renameIndex + intindex + stringnewname + + + Renames an entry defined by its index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry to rename. + + + + + newname + + + New name. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Rename one entry + +open('test.zip'); +if ($res === TRUE) { + $zip->renameIndex(2,'newname.txt'); + $zip->close(); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/renamename.xml b/reference/zip/ziparchive/renamename.xml new file mode 100644 index 0000000000..2e4935a95b --- /dev/null +++ b/reference/zip/ziparchive/renamename.xml @@ -0,0 +1,89 @@ + + + + + ZipArchive::renameName + Renames an entry defined by its name + + + &reftitle.description; + + boolZipArchive::renameName + stringname + stringnewname + + + Renames an entry defined by its name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry to rename. + + + + + newname + + + New name. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Rename one entry + +open('test.zip'); +if ($res === TRUE) { + $zip->renameName('currentname.txt','newname.txt'); + $zip->close(); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/setarchivecomment.xml b/reference/zip/ziparchive/setarchivecomment.xml new file mode 100644 index 0000000000..a9bfab4524 --- /dev/null +++ b/reference/zip/ziparchive/setarchivecomment.xml @@ -0,0 +1,82 @@ + + + + + ZipArchive::setArchiveComment + Set the comment of a ZIP archive + + + &reftitle.description; + + mixedZipArchive::setArchiveComment + stringcomment + + + Set the comment of a ZIP archive. + + + + &reftitle.parameters; + + + + comment + + + The contents of the comment. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Create an archive and set a comment + +open('test.zip', ZipArchive::CREATE); +if ($res === TRUE) { + $zip->addFromString('test.txt', 'file content goes here'); + $zip->setArchiveComment('new archive comment'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/setcommentindex.xml b/reference/zip/ziparchive/setcommentindex.xml new file mode 100644 index 0000000000..326408ac5e --- /dev/null +++ b/reference/zip/ziparchive/setcommentindex.xml @@ -0,0 +1,90 @@ + + + + + ZipArchive::setCommentIndex + Set the comment of an entry defined by its index + + + &reftitle.description; + + mixedZipArchive::setCommentIndex + intindex + stringcomment + + + Set the comment of an entry defined by its index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry. + + + + + comment + + + The contents of the comment. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Open an archive and set a comment for an entry + +open('test.zip'); +if ($res === TRUE) { + $zip->setCommentIndex(2, 'new entry comment'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/setcommentname.xml b/reference/zip/ziparchive/setcommentname.xml new file mode 100644 index 0000000000..5ed5f8db12 --- /dev/null +++ b/reference/zip/ziparchive/setcommentname.xml @@ -0,0 +1,90 @@ + + + + + ZipArchive::setCommentName + Set the comment of an entry defined by its name + + + &reftitle.description; + + mixedZipArchive::setCommentName + stringname + stringcomment + + + Set the comment of an entry defined by its name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry. + + + + + comment + + + The contents of the comment. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + Open an archive and set a comment for an entry + +open('test.zip'); +if ($res === TRUE) { + $zip->setCommentName('entry1.txt', 'new entry comment'); + $zip->close(); + echo 'ok'; +} else { + echo 'failed'; +} +?> +]]> + + + + + + diff --git a/reference/zip/ziparchive/statindex.xml b/reference/zip/ziparchive/statindex.xml new file mode 100644 index 0000000000..6e6b3f2112 --- /dev/null +++ b/reference/zip/ziparchive/statindex.xml @@ -0,0 +1,109 @@ + + + + + ZipArchive::statIndex + Get the details of an entry defined by its index. + + + &reftitle.description; + + mixedZipArchive::statIndex + intindex + intflags + + + The function obtains information about the entry defined by its + index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry + + + + + flags + + + ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request + information about the original file in the archive, + ignoring any changes made. + + + + + + + + &reftitle.returnvalues; + + Returns an array containing the entry details or &false; on failure. + + + + &reftitle.examples; + + Dump the stat info of an entry + +open('test.zip'); +if ($res === TRUE) { + print_r($zip->statIndex(3)); + $zip->close(); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + &example.outputs.similar; + + foobar/baz + [index] => 3 + [crc] => 499465816 + [size] => 27 + [mtime] => 1123164748 + [comp_size] => 24 + [comp_method] => 8 +) +]]> + + + + + + + + diff --git a/reference/zip/ziparchive/statname.xml b/reference/zip/ziparchive/statname.xml new file mode 100644 index 0000000000..72fabde85d --- /dev/null +++ b/reference/zip/ziparchive/statname.xml @@ -0,0 +1,127 @@ + + + + + ZipArchive::statName + Get the details of an entry defined by its name. + + + &reftitle.description; + + mixedZipArchive::statName + namename + intflags + + + The function obtains information about the entry defined by its + name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry + + + + + flags + + + The flags argument specifies how the name lookup should be done. + Also, ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request + information about the original file in the archive, + ignoring any changes made. + + + + ZIPARCHIVE::FL_NOCASE + + + + + ZIPARCHIVE::FL_NODIR + + + + + ZIPARCHIVE::FL_UNCHANGED + + + + + + + + + + + &reftitle.returnvalues; + + Returns an array containing the entry details or &false; on failure. + + + + &reftitle.examples; + + Dump the stat info of an entry + +open('test.zip'); +if ($res === TRUE) { + print_r($zip->statName('foobar/baz')); + $zip->close(); +} else { + echo 'failed, code:' . $res; +} +?> +]]> + + &example.outputs.similar; + + foobar/baz + [index] => 3 + [crc] => 499465816 + [size] => 27 + [mtime] => 1123164748 + [comp_size] => 24 + [comp_method] => 8 +) +]]> + + + + + + + + diff --git a/reference/zip/ziparchive/unchangeall.xml b/reference/zip/ziparchive/unchangeall.xml new file mode 100644 index 0000000000..d1443a9ddf --- /dev/null +++ b/reference/zip/ziparchive/unchangeall.xml @@ -0,0 +1,45 @@ + + + + + ZipArchive::unchangeAll + Undo all changes done in the archive. + + + &reftitle.description; + + mixedZipArchive::unchangeAll + + + + Undo all changes done in the archive. + + + + &reftitle.returnvalues; + + &return.success; + + + + + diff --git a/reference/zip/ziparchive/unchangearchive.xml b/reference/zip/ziparchive/unchangearchive.xml new file mode 100644 index 0000000000..7b3bcb5b83 --- /dev/null +++ b/reference/zip/ziparchive/unchangearchive.xml @@ -0,0 +1,46 @@ + + + + + ZipArchive::unchangeArchive + Revert all global changes done in the archive. + + + &reftitle.description; + + mixedZipArchive::unchangeArchive + + + + Revert all global changes to the archive archive. For now, this + only reverts archive comment changes. + + + + &reftitle.returnvalues; + + &return.success; + + + + + diff --git a/reference/zip/ziparchive/unchangeindex.xml b/reference/zip/ziparchive/unchangeindex.xml new file mode 100644 index 0000000000..1e74f5e544 --- /dev/null +++ b/reference/zip/ziparchive/unchangeindex.xml @@ -0,0 +1,60 @@ + + + + + ZipArchive::unchangeIndex + Revert all changes done to an entry at the given index. + + + &reftitle.description; + + mixedZipArchive::unchangeIndex + intindex + + + Revert all changes done to an entry at the given index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + diff --git a/reference/zip/ziparchive/unchangename.xml b/reference/zip/ziparchive/unchangename.xml new file mode 100644 index 0000000000..e4e2a0083f --- /dev/null +++ b/reference/zip/ziparchive/unchangename.xml @@ -0,0 +1,60 @@ + + + + + ZipArchive::unchangeName + Revert all changes done to an entry with the given name. + + + &reftitle.description; + + mixedZipArchive::unchangeName + stringname + + + Revert all changes done to an entry. + + + + &reftitle.parameters; + + + + name + + + Name of the entry. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + +