W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL phar >= 2.0.0)
PharData::addEmptyDir — 將一個(gè)空目錄添加到 tar/zip 存檔中
public PharData::addEmptyDir(string $directory): void
使用此方法,將創(chuàng)建一個(gè)帶有路徑的空目錄。 此方法類似于 ZipArchive::addEmptyDir()。dirname
directory
要在 phar 存檔中創(chuàng)建的空目錄的名稱
無返回值,失敗時(shí)引發(fā)異常。
示例 #1 A PharData::addEmptyDir() example
<?php
try {
$a = new PharData('/path/to/my.tar');
$a->addEmptyDir('/full/path/to/file');
// demonstrates how this file is stored
$b = $a['full/path/to/file']->isDir();
} catch (Exception $e) {
// handle errors here
}
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: