php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75143 new method setEncryptionName() seems not to exist in ZipArchive
Submitted: 2017-09-01 08:27 UTC Modified: -
From: it-solutions at schultz dot ch Assigned:
Status: Closed Package: zip (PECL)
PHP Version: 7.2.0RC1 OS: Windows Srv 2012 R2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: it-solutions at schultz dot ch
New email:
PHP Version: OS:

 

 [2017-09-01 08:27 UTC] it-solutions at schultz dot ch
Description:
------------
manual page: http://www.php.net/ziparchive.setencryptionname states 
(PHP >= 7.2, PECL zip >= 1.14.0) as dependencies
UPGRADING note https://github.com/php/php-src/blob/php-7.2.0RC1/UPGRADING states
relying on libzip 1.2.0 
---
I downloaded PHP 7.2.0rc1 from http://windows.php.net/qa/

When testing the new setEncryptionName functionality with the script from the php manual (see below), I get only the following error:

Call to undefined method ZipArchive::setEncryptionName()




Test script:
---------------
<?php
$zip = new ZipArchive();
if ($zip->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";
}
?>


Actual result:
--------------
receiving 
Call to undefined method ZipArchive::setEncryptionName()
error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-01 08:56 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a6456f0a6cf33565c21f7d691c0f6672b7bc64b7
Log: Fixed bug #75143 new method setEncryptionName() seems not to exist in ZipArchive
 [2017-09-01 08:56 UTC] ab@php.net
-Status: Open +Status: Closed
 [2017-09-15 13:52 UTC] it-solutions at schultz dot ch
Thanks a lot, I just tested the behaviour in PHP  7.2.rc2 and it successfully works - so we finally have a solution to encrypt ZIP files with passwords. I really love this!
Ruediger Schultz
Schultz IT Solutions
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC