php-doc-en/reference/zip/ziparchive/setpassword.xml
2018-07-13 18:06:26 +00:00

87 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="ziparchive.setpassword" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ZipArchive::setPassword</refname>
<refpurpose>Set the password for the active archive</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>ZipArchive::setPassword</methodname>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
</methodsynopsis>
<para>
Sets the password for the active archive.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>password</parameter></term>
<listitem>
<para>
The password to be used for the archive.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
As of PHP 7.2.0 and libzip 1.2.0 the password is used to decompress the archive,
and is also the default password for <methodname>ZipArchive::setEncryptionName</methodname>
and <methodname>ZipArchive::setEncryptionIndex</methodname>.
Formerly, this function only set the password to be used to decompress the archive;
it did not turn a non-password-protected <classname>ZipArchive</classname>
into a password-protected <classname>ZipArchive</classname>.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ZipArchive::setEncryptionIndex</methodname></member>
<member><methodname>ZipArchive::setEncryptionName</methodname></member>
</simplelist>
</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:"~/.phpdoc/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
-->