mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-07-23 16:51:12 +02:00
Skipped some tests for php 32-bit platform.
This commit is contained in:
@@ -50,6 +50,10 @@
|
||||
- Поддержка `ZIP64` (размер файла более 4 GB или количество записей в архиве более 65535).
|
||||
- Встроенная поддержка выравнивания архива для оптимизации Android пакетов (APK) [`zipalign`](https://developer.android.com/studio/command-line/zipalign.html).
|
||||
- Работа с паролями для PHP 5.5
|
||||
> **Внимание!**
|
||||
>
|
||||
> Для 32-bit систем, в данный момент не поддерживается метод шифрование `Traditional PKWARE Encryption (ZipCrypto)`.
|
||||
> Используйте метод шифрования `WinZIP AES Encryption`, когда это возможно.
|
||||
+ Установка пароля для чтения архива глобально или для некоторых записей.
|
||||
+ Изменение пароля архива, в том числе и для отдельных записей.
|
||||
+ Удаление пароля архива глобально или для отдельных записей.
|
||||
|
@@ -50,6 +50,10 @@ Table of contents
|
||||
- Support for `ZIP64` (file size is more than 4 GB or the number of entries in the archive is more than 65535).
|
||||
- Built-in support for aligning the archive to optimize Android packages (APK) [`zipalign`](https://developer.android.com/studio/command-line/zipalign.html).
|
||||
- Working with passwords for PHP 5.5
|
||||
> **Attention!**
|
||||
>
|
||||
> For 32-bit systems, the `Traditional PKWARE Encryption (ZipCrypto)` encryption method is not currently supported.
|
||||
> Use the encryption method `WinZIP AES Encryption`, whenever possible.
|
||||
+ Set the password to read the archive for all entries or only for some.
|
||||
+ Change the password for the archive, including for individual entries.
|
||||
+ Delete the archive password for all or individual entries.
|
||||
|
@@ -54,10 +54,12 @@ class PackUtil
|
||||
*/
|
||||
public static function toSignedInt32($int)
|
||||
{
|
||||
if (PHP_INT_SIZE === 8) {
|
||||
$int = $int & 0xffffffff;
|
||||
if (PHP_INT_SIZE === 8 && ($int & 0x80000000)) {
|
||||
if ($int & 0x80000000) {
|
||||
return $int - 0x100000000;
|
||||
}
|
||||
}
|
||||
return $int;
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,9 @@ use PhpZip\Exception\ZipAuthenticationException;
|
||||
use PhpZip\Model\ZipInfo;
|
||||
use PhpZip\Util\CryptoUtil;
|
||||
|
||||
/**
|
||||
* Tests with zip password.
|
||||
*/
|
||||
class ZipPasswordTest extends ZipFileAddDirTest
|
||||
{
|
||||
/**
|
||||
@@ -13,6 +16,10 @@ class ZipPasswordTest extends ZipFileAddDirTest
|
||||
*/
|
||||
public function testSetPassword()
|
||||
{
|
||||
if (PHP_INT_SIZE === 4) {
|
||||
$this->markTestSkipped('Skip test for 32-bit system. Not support Traditional PKWARE Encryption.');
|
||||
}
|
||||
|
||||
$password = base64_encode(CryptoUtil::randomBytes(100));
|
||||
$badPassword = "sdgt43r23wefe";
|
||||
|
||||
@@ -96,6 +103,10 @@ class ZipPasswordTest extends ZipFileAddDirTest
|
||||
|
||||
public function testTraditionalEncryption()
|
||||
{
|
||||
if (PHP_INT_SIZE === 4) {
|
||||
$this->markTestSkipped('Skip test for 32-bit system. Not support Traditional PKWARE Encryption.');
|
||||
}
|
||||
|
||||
$password = base64_encode(CryptoUtil::randomBytes(50));
|
||||
|
||||
$zip = new ZipFile();
|
||||
|
Reference in New Issue
Block a user