From a0f65747b075a351958b95cb9f69ec5146c22d90 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 5 Apr 2017 09:15:44 +0000 Subject: [PATCH] add ZipArchive::setEncryptionIndex and ZipArchive::setEncryptionName (from 1.14.0) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342241 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/zip/versions.xml | 2 + .../zip/ziparchive/setencryptionindex.xml | 79 +++++++++++++ .../zip/ziparchive/setencryptionname.xml | 107 ++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 reference/zip/ziparchive/setencryptionindex.xml create mode 100644 reference/zip/ziparchive/setencryptionname.xml diff --git a/reference/zip/versions.xml b/reference/zip/versions.xml index 1c8587d154..91a3dd4422 100644 --- a/reference/zip/versions.xml +++ b/reference/zip/versions.xml @@ -35,6 +35,8 @@ + + diff --git a/reference/zip/ziparchive/setencryptionindex.xml b/reference/zip/ziparchive/setencryptionindex.xml new file mode 100644 index 0000000000..73a9881d4a --- /dev/null +++ b/reference/zip/ziparchive/setencryptionindex.xml @@ -0,0 +1,79 @@ + + + + + ZipArchive::setEncryptionIndex + Set the encryption method of an entry defined by its index + + + &reftitle.description; + + bool + ZipArchive::setEncryptionIndex + intindex + stringmethod + stringpassword + + + Set the encryption method of an entry defined by its index. + + + + &reftitle.parameters; + + + + index + + + Index of the entry. + + + + + method + + + The encryption method defined by one of the ZipArchive::EM_ constants. + + + + + password + + + Optional password, default used when missing. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + diff --git a/reference/zip/ziparchive/setencryptionname.xml b/reference/zip/ziparchive/setencryptionname.xml new file mode 100644 index 0000000000..945b997f31 --- /dev/null +++ b/reference/zip/ziparchive/setencryptionname.xml @@ -0,0 +1,107 @@ + + + + + ZipArchive::setEncryptionName + Set the encryption method of an entry defined by its name + + + &reftitle.description; + + bool + ZipArchive::setEncryptionName + stringname + intmethod + stringpassword + + + Set the encryption method of an entry defined by its name. + + + + &reftitle.parameters; + + + + name + + + Name of the entry. + + + + + method + + + The encryption method defined by one of the ZipArchive::EM_ constants. + + + + + password + + + Optional password, default used when missing. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + This example creates a ZIP file archive + test.zip and add + the file test.txt + encrypted using the AES 256 method. + + + Archive and encrypt a file + +open('test.zip', ZipArchive::CREATE) === TRUE) { + $zip->setPassword('secret'); + $zip->addFile('text.txt'); + $zip->setEncryptionName('text.txt', ZipArchive::EM_AES_256); + $zip->close(); + echo "Ok\n"; +} else { + echo "KO\n"; +} +?> +]]> + + + + + +