PHP8 ZipArchive::setEncryptionIndex

2024-02-27 11:09 更新

(PHP >= 7.2.0, PHP 8, PECL zip >= 1.14.0)

ZipArchive::setEncryptionIndex — 設(shè)置由其索引定義的條目的加密方法

說明

public ZipArchive::setEncryptionIndex(int $index, int $method, ?string $password = null): bool

設(shè)置由其索引定義的條目的加密方法。

參數(shù) 

index

條目的索引。

method

由 ZipArchive::EM_ 常量之一定義的加密方法。

password

可選密碼,缺失時默認(rèn)使用。

返回值 

成功時返回 true, 或者在失敗時返回 false。

更新日志 

版本說明
8.0.0password現(xiàn)在是可為 null 的。

注釋 

注意:僅當(dāng)針對 libzip ≥ 1.2.0 構(gòu)建時,此函數(shù)才可用。

參見 

  • ZipArchive::setPassword() - 設(shè)置活動存檔的密碼
  • ZipArchive::setEncryptionName() - 設(shè)置由其名稱定義的條目的加密方法


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號