(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL phar >= 1.0.0)
Phar 類別提供了一個高階介面,用於存取和建立 phar 封存檔。
$filename
, int $flags
= FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS, ?string $alias
= null
)(譯註:建構子,參數:檔名(字串),旗標(整數,預設為 FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS),別名(字串或null,預設為 null))
$filename
, ?string $localName
= null
): void(譯註:新增檔案,參數:檔名(字串),在phar檔案中的名稱(字串或null,預設為 null),回傳:無)
$localName
, string $contents
): void(譯註:從字串新增檔案,參數:在phar檔案中的名稱(字串),檔案內容(字串),回傳:無)
$format
= null
, ?int $compression
= null
, ?string $extension
= null
): ?Phar$alias
= null
,$index
= null
,$fileNotFoundScript
= null
,$mimeTypes
= [],$rewrite
= null
$mode
= "r", 布林值 $useIncludePath
= false
, ?資源 $context
= null
): SplFileObject版本 | 說明 |
---|---|
8.4.0 | 增加了對基於 Zip 封存的 Unix 時間戳記擴充的支援。 |