(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL phar >= 2.0.0)
PharData 類別提供了一個高階介面,用於存取和建立不可執行的 tar 和 zip 封存檔。由於這些封存檔不包含 stub 且無法由 phar 擴充功能執行,因此即使 php.ini 設定中的 phar.readonly
為 1
,也可以使用 PharData 類別建立和操作普通的 zip 和 tar 檔案。
$filename
,$flags
= FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS,$alias
= null
,$format
= 0$format
= null
, ?int $compression
= null
, ?string $extension
= null
): ?PharData$format
= null
, ?int $compression
= null
, ?string $extension
= null
): ?Phar$mode
= "r", 布林值 $useIncludePath
= false
, ?資源 $context
= null
): SplFileObject