mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
- Add documentation for the new Zip extension (add new OO interface)
- Update the installation and reference pages (pecl, php4, 5.2+) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@217987 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a5b709a405
commit
ead062f704
29 changed files with 3058 additions and 51 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<section id="zip.installation">
|
||||
&reftitle.install;
|
||||
<para>
|
||||
|
@ -7,24 +7,61 @@
|
|||
&pecl.info;
|
||||
<ulink url="&url.pecl.package;zip">&url.pecl.package;zip</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
&pecl.source.4;
|
||||
In order to use these functions you must compile PHP with zip support
|
||||
by using the <option role="configure">--with-zip[=DIR]</option>
|
||||
configure option.
|
||||
</para>
|
||||
<para>
|
||||
Windows users will enable <filename>php_zip.dll</filename> inside
|
||||
of &php.ini; in order to use these functions.
|
||||
&pecl.windows.4;
|
||||
&pecl.windows.download;
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Zip support before PHP 4.1.0 is experimental. This section
|
||||
reflects the Zip extension as it exists in PHP 4.1.0 and later.
|
||||
</para>
|
||||
</note>
|
||||
<section id="zip.installation.linux">
|
||||
<title>Installation on Linux</title>
|
||||
<section>
|
||||
<title>Installation when bundled with PHP4</title>
|
||||
<para>
|
||||
In order to use these functions you must compile PHP with zip support
|
||||
by using the <option role="configure">--with-zip[=DIR]</option>
|
||||
configure option, where [DIR] is the prefix of the <ulink
|
||||
url="&url.zziplib;">ZZIPlib</ulink> library install.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Installation with PECL or bundled with PHP 5.2 or earlier</title>
|
||||
<para>
|
||||
In order to use these functions you must compile PHP with zip support
|
||||
by using the <option role="configure">--enable-zip</option>
|
||||
configure option. It does require any external library.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
You can use the PECL version with PHP4. In order to do it you
|
||||
have to disable the bundled Zip extension or recompile PHP without
|
||||
it.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="zip.installation.windows">
|
||||
<title>Installation on Windows</title>
|
||||
<section>
|
||||
<title>Installation when bundled with PHP4</title>
|
||||
<para>
|
||||
Windows users will enable <filename>php_zip.dll</filename> inside
|
||||
of &php.ini; in order to use these functions.
|
||||
&pecl.windows.4;
|
||||
&pecl.windows.download;
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Zip support before PHP 4.1.0 is experimental. This section
|
||||
reflects the Zip extension as it exists in PHP 4.1.0 and later.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
<section>
|
||||
<title>Installation with PECL or bundled with PHP 5.2 or earlier</title>
|
||||
<para>
|
||||
Windows users will enable <filename>php_zip.dll</filename> inside
|
||||
of &php.ini; in order to use these functions.
|
||||
&pecl.windows.4;
|
||||
&pecl.windows.download;
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
516
reference/zip/constants.xml
Normal file
516
reference/zip/constants.xml
Normal file
|
@ -0,0 +1,516 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<section id="pdo.constants">
|
||||
&reftitle.constants;
|
||||
&extension.constants;
|
||||
|
||||
<para>
|
||||
ZipArchive uses class constants. There is three types of constants,
|
||||
Flags (FL_) errors (ER_) or mode (no prefix).
|
||||
</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CREATE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Create the archive if it does not exist.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::EXCL</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Error if archive already exists.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CHECKCONS</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Perform additional consistency checks on the archive, and error if they fail.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::FL_NOCASE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Ignore case on name lookup
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::FL_NODIR</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Ignore directory component
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::FL_COMPRESSED</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Read compressed data
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::FL_UNCHANGED</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Use original data, ignoring changes.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_DEFAULT</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
better of deflate or store.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_STORE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
stored (uncompressed).
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_SHRINK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
shrunk
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_REDUCE_1</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
reduced with factor 1
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_REDUCE_2</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
reduced with factor 2
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_REDUCE_3</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
reduced with factor 3
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_REDUCE_4</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
reduced with factor 4
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_IMPLODE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
imploded
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_DEFLATE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
deflated64
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_DEFLATE64</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
deflated64
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_PKWARE_IMPLODE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
PKWARE imploding
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::CM_BZIP2</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
BZIP2 algorithm
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_OK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
No error.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_MULTIDISK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_RENAME</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Multi-disk zip archives not supported.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_CLOSE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Closing zip archive failed
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_SEEK</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Seek error
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_READ</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Read error
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_WRITE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Write error
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_CRC</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
CRC error
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_ZIPCLOSED</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Containing zip archive was closed
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_NOENT</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
No such file.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_EXISTS</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
File already exists
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_OPEN</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Can't open file
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_TMPOPEN</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Failure to create temporary file.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_ZLIB</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Zlib error
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_MEMORY</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Memory allocation failure
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_CHANGED</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Entry has been changed
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_COMPNOTSUPP</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Compression method not supported.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_EOF</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Premature EOF
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_INVAL</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invalid argument
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_NOZIP</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Not a zip archive
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_INTERNAL</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Internal error
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_INCONS</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_REMOVE</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Zip archive inconsistent
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>ZIPARCHIVE::ER_DELETED</constant>
|
||||
(<type>integer</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Entry has been deleted
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
95
reference/zip/functions/ziparchive-addfile.xml
Normal file
95
reference/zip/functions/ziparchive-addfile.xml
Normal file
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-addfile">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::addFile</refname>
|
||||
<refpurpose>Adds a file to a ZIP archive from the given path</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::addFile</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>localname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Adds a file to a ZIP archive from a given path
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The path to the file to add.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>localname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
local name inside ZIP archive.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
This example opens a ZIP file archive, reads each file in the
|
||||
archive and prints out its contents. The
|
||||
<filename>test.zip</filename> archive used in this example is
|
||||
one of the test archives in the ext/zip/examples directory.
|
||||
</para>
|
||||
<example>
|
||||
<title>Open and extract</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open('test.zip')) {
|
||||
$zip->addFile('/path/to/index.txt'), 'newname.txt');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
108
reference/zip/functions/ziparchive-addfromstring.xml
Normal file
108
reference/zip/functions/ziparchive-addfromstring.xml
Normal file
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-addfromstring">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::addFromString</refname>
|
||||
<refpurpose>Add a file to a ZIP archive using its contents</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::addFromString</methodname>
|
||||
<methodparam><type>string</type><parameter>localname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Add a file to a ZIP archive using its contents.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>localname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the entry to create.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>contents</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The contents to use to create the entry. It is used in a binary
|
||||
safe mode.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Add an entry to a new archive</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip', ZipArchive::CREATE);
|
||||
if ($res) {
|
||||
$zip->addFromString('test.txt', 'file content goes here');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Add file to a directory inside an archive</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open(realpath('test.zip'))) {
|
||||
$zip->addFromString('dir/test.txt', 'file content goes here');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
46
reference/zip/functions/ziparchive-close.xml
Normal file
46
reference/zip/functions/ziparchive-close.xml
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-close">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::close</refname>
|
||||
<refpurpose>Close the active archive (opened or newly created)</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::close</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Close opened or created archive and save changes. This method is
|
||||
automatically called at the end of the script.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
80
reference/zip/functions/ziparchive-deleteindex.xml
Normal file
80
reference/zip/functions/ziparchive-deleteindex.xml
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-deleteindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::deleteIndex</refname>
|
||||
<refpurpose>delete an entry in the archive using its index</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::deleteIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Delete an entry in the archive using its index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry to delete.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Delete file from archive using its index</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open(realpath('test.zip'))) {
|
||||
$zip->deleteIndex(2);
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
80
reference/zip/functions/ziparchive-deletename.xml
Normal file
80
reference/zip/functions/ziparchive-deletename.xml
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-deletename">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::deleteName</refname>
|
||||
<refpurpose>delete an entry in the archive using its name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::deleteName</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Delete an entry in the archive using its name.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of the entry to delete.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Delete file from archive using its name</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open(realpath('test1.zip'))) {
|
||||
$zip->deleteName('testfromfile.php');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
115
reference/zip/functions/ziparchive-extractto.xml
Normal file
115
reference/zip/functions/ziparchive-extractto.xml
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-extractto">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::extractTo</refname>
|
||||
<refpurpose>Extract the archive contents</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::extractTo</methodname>
|
||||
<methodparam><type>string</type><parameter>destination</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>entries</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Extract the complete archive or the given files to the specified
|
||||
destination.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>destination</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Location where to extract the files.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>entries</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The entries to extract. It accepts either a single entry name or
|
||||
an array of names.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
This example opens a ZIP file archive, reads each file in the
|
||||
archive and prints out its contents. The
|
||||
<filename>test2.zip</filename> archive used in this example is
|
||||
one of the test archives in the ZZIPlib source distribution.
|
||||
</para>
|
||||
<example>
|
||||
<title>Extract all entries</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open('test.zip')) {
|
||||
$zip->extractTo('/my/destination/dir/');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Extract only tow entries</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->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';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
66
reference/zip/functions/ziparchive-getarchivecomment.xml
Normal file
66
reference/zip/functions/ziparchive-getarchivecomment.xml
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getarchivecomment">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getArchiveComment</refname>
|
||||
<refpurpose>Returns the Zip archive comment</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getArchiveComment</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the Zip archive comment or false on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Dump an archive comment</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->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;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
89
reference/zip/functions/ziparchive-getcommentindex.xml
Normal file
89
reference/zip/functions/ziparchive-getcommentindex.xml
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getcommentindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getCommentIndex</refname>
|
||||
<refpurpose>Returns the comment of an entry using the entry index</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getCommentIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the comment of an entry using the entry index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If flags is set to <constant>ZIPARCHIVE::FL_UNCHANGED</constant>, the original unchanged
|
||||
comment is returned.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the comment on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Dump an entry comment</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test1.zip')
|
||||
if ($res === TRUE) {
|
||||
var_dump($zip->getCommentIndex(1));
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
89
reference/zip/functions/ziparchive-getcommentname.xml
Normal file
89
reference/zip/functions/ziparchive-getcommentname.xml
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getcommentname">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getCommentName</refname>
|
||||
<refpurpose>Returns the comment of an entry using the entry name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getCommentName</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the comment of an entry using the entry name.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of the entry
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If flags is set to <constant>ZIPARCHIVE::FL_UNCHANGED</constant>, the original unchanged
|
||||
comment is returned.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the comment on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Dump an entry comment</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test1.zip')
|
||||
if ($res === TRUE) {
|
||||
var_dump($zip->getCommentName('test/entry1.txt'));
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
101
reference/zip/functions/ziparchive-getfromindex.xml
Normal file
101
reference/zip/functions/ziparchive-getfromindex.xml
Normal file
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getfromindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getFromIndex</refname>
|
||||
<refpurpose>Returns the entry contents using its index.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getFromIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the entry contents using its index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The flags to use to open the archive. the following values may
|
||||
be ORed to it.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_UNCHANGED</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_COMPRESSED</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the contents of the entry on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Get the file contents</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open(realpath('test.zip'))) {
|
||||
echo $zip->getFromIndex(2);
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
125
reference/zip/functions/ziparchive-getfromname.xml
Normal file
125
reference/zip/functions/ziparchive-getfromname.xml
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getfromname">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getFromName</refname>
|
||||
<refpurpose>Returns the entry contents using its name.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getFromName</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the entry contents using its name.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of the entry
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The flags to use to open the archive. the following values may
|
||||
be ORed to it.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_NOCASE</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_NODIR</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_UNCHANGED</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_COMPRESSED</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &true; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Get the file contents</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->open(realpath('test1.zip'))) {
|
||||
echo $zip->getFromName('testfromfile.php');
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Convert an image from a zip entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$z = new ZipArchive();
|
||||
$z->open(dirname(__FILE__) . '/test_im.zip');
|
||||
$im_string = $z->getFromName("pear_item.gif");
|
||||
$im = imagecreatefromstring($im_string);
|
||||
imagepng($im, 'b.png');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
60
reference/zip/functions/ziparchive-getnameindex.xml
Normal file
60
reference/zip/functions/ziparchive-getnameindex.xml
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getnameindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getNameIndex</refname>
|
||||
<refpurpose>Returns the name of an entry using its index</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getNameIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the name of an entry using its index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the name on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
118
reference/zip/functions/ziparchive-getstream.xml
Normal file
118
reference/zip/functions/ziparchive-getstream.xml
Normal file
|
@ -0,0 +1,118 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-getstream">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::getStream</refname>
|
||||
<refpurpose>Get a file handler to the entry defined by its name (read only).</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::getStream</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get a file handler to the entry defined by its name. For now it only
|
||||
supports read operations.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the entry to use.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a file pointer (resource) on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Get the entry contents with fread and store it.</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$content = '';
|
||||
$z = new ZipArchive();
|
||||
$z->open(dirname(__FILE__) . '/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";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Same as the previous example but with fopen and the zip
|
||||
stream wrapper</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$fp = fopen('zip://' . dirname(__FILE__) . '/test.zip#test', 'r');
|
||||
if (!$fp) {
|
||||
exit("cannot open\n");
|
||||
}
|
||||
while (!feof($fp)) {
|
||||
$contents .= fread($fp, 2);
|
||||
echo "$contents\n";
|
||||
}
|
||||
fclose($fp);
|
||||
echo "done.\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Stream wrapper and image, can be used with the xml function
|
||||
as well</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$im = imagecreatefromgif('zip://' . dirname(__FILE__) . '/test_im.zip#pear_item.gif');
|
||||
imagepng($im, 'a.png');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
121
reference/zip/functions/ziparchive-locatename.xml
Normal file
121
reference/zip/functions/ziparchive-locatename.xml
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-locatename">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::locateName</refname>
|
||||
<refpurpose>Open a ZIP file archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::locateName</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Locates an entry using its name.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the entry to look up
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The function returns the index of the file named fname in
|
||||
archive. The flags are specified by ORing the following values,
|
||||
or 0 for none of them.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_NOCASE</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_NODIR</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the index of the entry on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Create an archive and then use it with locateName</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$file = 'testlocate.zip';
|
||||
|
||||
$zip = new ZipArchive;
|
||||
if ($zip->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();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
188
reference/zip/functions/ziparchive-open.xml
Normal file
188
reference/zip/functions/ziparchive-open.xml
Normal file
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-open">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::open</refname>
|
||||
<refpurpose>Open a ZIP file archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::open</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Opens a new zip archive for reading, writing or modifying.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The file name of the ZIP archive to open.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The mode to use to open the archive.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::CREATE</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::EXCL</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::CHECKCONS</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>Error codes</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Returns &true; on success or the error code.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_EXISTS</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_INCONS</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_INVAL</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_MEMORY</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_NOENT</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_NOZIP</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_OPEN</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_READ</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::ER_SEEK</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
This example opens a ZIP file archive, reads each file in the
|
||||
archive and prints out its contents. The
|
||||
<filename>test2.zip</filename> archive used in this example is
|
||||
one of the test archives in the ZZIPlib source distribution.
|
||||
</para>
|
||||
<example>
|
||||
<title>Open and extract</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip')
|
||||
if ($res === TRUE) {
|
||||
echo 'ok';
|
||||
$zip->extractTo('test');
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Create an archive</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->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';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
89
reference/zip/functions/ziparchive-renameindex.xml
Normal file
89
reference/zip/functions/ziparchive-renameindex.xml
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-renameindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::renameIndex</refname>
|
||||
<refpurpose>Renames an entry defined by its index</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::renameIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>newname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Renames an entry defined by its index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry to rename.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>newname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
New name.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Rename one entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip')
|
||||
if ($res === TRUE) {
|
||||
$zip->renameIndex(2,'newname.txt');
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
89
reference/zip/functions/ziparchive-renamename.xml
Normal file
89
reference/zip/functions/ziparchive-renamename.xml
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-renamename">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::renameName</refname>
|
||||
<refpurpose>Renames an entry defined by its name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>boolean</type><methodname>ZipArchive::renameName</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>newname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Renames an entry defined by its index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry to rename.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>newname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
New name.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Rename one entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip')
|
||||
if ($res === TRUE) {
|
||||
$zip->renameIndex('currentname.txt','newname.txt');
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
82
reference/zip/functions/ziparchive-setarchivecomment.xml
Normal file
82
reference/zip/functions/ziparchive-setarchivecomment.xml
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-setarchivecomment">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::setArchiveComment</refname>
|
||||
<refpurpose>Set the comment of a ZIP archive</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::setArchiveComment</methodname>
|
||||
<methodparam><type>string</type><parameter>comment</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set the comment of a ZIP archive.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>comment</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The contents of the comment.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Create an archive and set a comment</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip', ZipArchive::CREATE);
|
||||
if ($res === TRUE) {
|
||||
$zip->addFromString('test.txt', 'file content goes here');
|
||||
$z->setArchiveComment('new archive comment');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
90
reference/zip/functions/ziparchive-setcommentindex.xml
Normal file
90
reference/zip/functions/ziparchive-setcommentindex.xml
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-setcommentindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::setCommentIndex</refname>
|
||||
<refpurpose>Set the comment of an entry defined by its index</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::setCommentIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>comment</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set the comment of an entry defined by its index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>comment</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The contents of the comment.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Open an archive and set a comment for an entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip');
|
||||
if ($res === TRUE) {
|
||||
$z->setCommentIndex(2, 'new entry comment');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
90
reference/zip/functions/ziparchive-setcommentname.xml
Normal file
90
reference/zip/functions/ziparchive-setcommentname.xml
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-setCommentName">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::setCommentName</refname>
|
||||
<refpurpose>Set the comment of an entry defined by its name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::setCommentIndex</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>comment</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set the comment of an entry defined by its name.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of the entry.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>comment</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The contents of the comment.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Open an archive and set a comment for an entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip');
|
||||
if ($res === TRUE) {
|
||||
$z->setCommentName('entry1.txt', 'new entry comment');
|
||||
$zip->close();
|
||||
echo 'ok';
|
||||
} else {
|
||||
echo 'failed';
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
111
reference/zip/functions/ziparchive-statindex.xml
Normal file
111
reference/zip/functions/ziparchive-statindex.xml
Normal file
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-statindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::statIndex</refname>
|
||||
<refpurpose>Get the details of an entry defined by its index.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::statIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function obtains information about the entry defined by its
|
||||
index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_UNCHANGED</constant> may be ORed to it to request
|
||||
information about the original file in the archive,
|
||||
ignoring any changes made.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an array containing the entry details or false on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Dump the stat info of an entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip')
|
||||
if ($res === TRUE) {
|
||||
print_r($zip->statIndex(3));
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This example will output :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[name] => foobar/baz
|
||||
[index] => 3
|
||||
[crc] => 499465816
|
||||
[size] => 27
|
||||
[mtime] => 1123164748
|
||||
[comp_size] => 24
|
||||
[comp_method] => 8
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
129
reference/zip/functions/ziparchive-statname.xml
Normal file
129
reference/zip/functions/ziparchive-statname.xml
Normal file
|
@ -0,0 +1,129 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-statname">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::statName</refname>
|
||||
<refpurpose>Get the details of an entry defined by its name.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::statName</methodname>
|
||||
<methodparam><type>name</type><parameter>name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>integer</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The function obtains information about the entry defined by its
|
||||
name.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The flags argument specifies how the name lookup should be done.
|
||||
Also, <constant>ZIPARCHIVE::FL_UNCHANGED</constant> may be ORed to it to request
|
||||
information about the original file in the archive,
|
||||
ignoring any changes made.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_NOCASE</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_NODIR</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<constant>ZIPARCHIVE::FL_UNCHANGED</constant>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an array containing the entry details or false on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Dump the stat info of an entry</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open('test.zip')
|
||||
if ($res === TRUE) {
|
||||
print_r($zip->statName('foobar/baz'));
|
||||
$zip->close();
|
||||
} else {
|
||||
echo 'failed, code:' . $res;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This example will output :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[name] => foobar/baz
|
||||
[index] => 3
|
||||
[crc] => 499465816
|
||||
[size] => 27
|
||||
[mtime] => 1123164748
|
||||
[comp_size] => 24
|
||||
[comp_method] => 8
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
45
reference/zip/functions/ziparchive-unchangeall.xml
Normal file
45
reference/zip/functions/ziparchive-unchangeall.xml
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-unchangeall">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::unchangeAll</refname>
|
||||
<refpurpose>Undo all changes done in the archive.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::unchangeAll</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Undo all changes done in the archive.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
46
reference/zip/functions/ziparchive-unchangearchive.xml
Normal file
46
reference/zip/functions/ziparchive-unchangearchive.xml
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-unchangearchive">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::unchangeArchive</refname>
|
||||
<refpurpose>Revert all global changes done in the archive.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::unchangeArchive</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Revert all global changes to the archive archive. For now, this
|
||||
only reverts archive comment changes.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
60
reference/zip/functions/ziparchive-unchangeindex.xml
Normal file
60
reference/zip/functions/ziparchive-unchangeindex.xml
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry id="function.ziparchive-unchangeindex">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::unchangeIndex</refname>
|
||||
<refpurpose>Revert all changes done to an entry at the given index.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::unchangeIndex</methodname>
|
||||
<methodparam><type>integer</type><parameter>index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Revert all changes done to an entry at the given index.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Index of the entry.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
61
reference/zip/functions/ziparchive-unchangename.xml
Normal file
61
reference/zip/functions/ziparchive-unchangename.xml
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- splitted from ./en/functions/zip.xml, last change in rev 1.11 -->
|
||||
<refentry id="function.ziparchive-unchangename">
|
||||
<refnamediv>
|
||||
<refname>ZipArchive::unchangeName</refname>
|
||||
<refpurpose>Revert all changes done to an entry with the given name.</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>ZipArchive::unchangeName</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Revert all changes done to an entry.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of the entry.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &false; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,42 +1,49 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- Purpose: compression -->
|
||||
<!-- Membership: pecl -->
|
||||
|
||||
<reference id="ref.zip">
|
||||
<title>Zip File Functions (Read Only Access)</title>
|
||||
<title>Zip File Functions</title>
|
||||
<titleabbrev>Zip</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
<section id="zip.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
This module enables you to transparently read ZIP compressed
|
||||
This module enables you to transparently read or write ZIP compressed
|
||||
archives and the files inside them.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="zip.requirements">
|
||||
&reftitle.required;
|
||||
<section>
|
||||
<title>PHP4 Bundled</title>
|
||||
<para>
|
||||
The initial version is bundled in PHP 4 and is available in PECL
|
||||
as version 1.0, see <ulink url="&url.pecl.package;zip">
|
||||
&url.pecl.package;zip</ulink>. It can only read Zip Archives.
|
||||
</para>
|
||||
<para>
|
||||
This version uses the functions of the <ulink
|
||||
url="&url.zziplib;">ZZIPlib</ulink> library by Guido Draheim.
|
||||
You need ZZIPlib version >= 0.10.6.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>PECL and PHP 5.2 or earlier</title>
|
||||
<para>
|
||||
This module uses the functions of the <ulink
|
||||
url="&url.zziplib;">ZZIPlib</ulink> library by Guido Draheim.
|
||||
You need ZZIPlib version >= 0.10.6.
|
||||
</para>
|
||||
<para>
|
||||
The PECL package version 1.1.0 and up does not require any external
|
||||
library. It also provides a write mode (creations and modifications).
|
||||
The new features are not yet documented, please check the examples
|
||||
included in the releases.
|
||||
</para>
|
||||
<para>
|
||||
Note that ZZIPlib only provides a subset of functions
|
||||
provided in a full implementation of the ZIP compression algorithm
|
||||
and can only read ZIP file archives. A normal ZIP utility is
|
||||
needed to create the ZIP file archives read by this library.
|
||||
The newest version is bundled in PHP 5.2.0 or earlier and
|
||||
available in PECL, as version 1.1.0 or earlier. It does not
|
||||
require any external library. It can read and write Zip archives
|
||||
when used with PHP 5.1 or ealier and can only read them when used
|
||||
with PHP4.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
&reference.zip.configure;
|
||||
|
||||
<section id="zip.configuration">
|
||||
|
@ -46,21 +53,98 @@
|
|||
|
||||
<section id="zip.resources">
|
||||
&reftitle.resources;
|
||||
&no.resource;
|
||||
<para>
|
||||
There are two resource types used in the Zip module. The first one
|
||||
is the Zip directory for the Zip archive, the second Zip Entry for
|
||||
the archive entries.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="zip.constants">
|
||||
&reftitle.constants;
|
||||
&no.constants;
|
||||
</section>
|
||||
&reference.zip.constants;
|
||||
|
||||
<section id="zip.examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Create a Zip archive</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$filename = "./test112.zip";
|
||||
|
||||
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
|
||||
exit("cannot open <$filename>\n");
|
||||
}
|
||||
|
||||
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
|
||||
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
|
||||
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
|
||||
echo "numfiles: " . $zip->numFiles . "\n";
|
||||
echo "status:" . $zip->status . "\n";
|
||||
$zip->close();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Dump the archive details and listing</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$za = new ZipArchive();
|
||||
|
||||
$za->open('test_with_comment.zip');
|
||||
print_r($za);
|
||||
var_dump($za);
|
||||
echo "numFiles: " . $za->numFiles . "\n";
|
||||
echo "status: " . $za->status . "\n";
|
||||
echo "statusSys: " . $za->statusSys . "\n";
|
||||
echo "filename: " . $za->filename . "\n";
|
||||
echo "comment: " . $za->comment . "\n";
|
||||
|
||||
for ($i=0; $i<$za->numFiles;$i++) {
|
||||
echo "index: $i\n";
|
||||
print_r($za->statIndex($i));
|
||||
}
|
||||
echo "numFile:" . $za->numFiles . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Zip stream wrapper, read an OpenOffice meta info</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$reader = new XMLReader();
|
||||
|
||||
$reader->open('zip://' . dirname(__FILE__) . '/test.odt#meta.xml');
|
||||
$odt_meta = array();
|
||||
while ($reader->read()) {
|
||||
if ($reader->nodeType == XMLREADER::ELEMENT) {
|
||||
$elm = $reader->name;
|
||||
} else {
|
||||
if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') {
|
||||
break;
|
||||
}
|
||||
if (!trim($reader->value)) {
|
||||
continue;
|
||||
}
|
||||
$odt_meta[$elm] = $reader->value;
|
||||
}
|
||||
}
|
||||
print_r($odt_meta);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
This example opens a ZIP file archive, reads each file in the
|
||||
archive and prints out its contents. The
|
||||
<filename>test2.zip</filename> archive used in this example is
|
||||
one of the test archives in the ZZIPlib source distribution.
|
||||
This example uses the old API (PHP 4), it opens a ZIP file
|
||||
archive, reads each file in the archive and prints out its
|
||||
contents. The <filename>test2.zip</filename> archive used in this
|
||||
example is one of the test archives in the ZZIPlib source
|
||||
distribution.
|
||||
</para>
|
||||
<example>
|
||||
<title>Zip Usage Example</title>
|
||||
|
@ -71,7 +155,6 @@
|
|||
$zip = zip_open("/tmp/test2.zip");
|
||||
|
||||
if ($zip) {
|
||||
|
||||
while ($zip_entry = zip_read($zip)) {
|
||||
echo "Name: " . zip_entry_name($zip_entry) . "\n";
|
||||
echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n";
|
||||
|
@ -92,7 +175,6 @@ if ($zip) {
|
|||
zip_close($zip);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@ -101,7 +183,6 @@ if ($zip) {
|
|||
</partintro>
|
||||
|
||||
&reference.zip.functions;
|
||||
|
||||
</reference>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
Loading…
Reference in a new issue