downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

PharData::addFile> <PharData
[edit] Last updated: Fri, 25 May 2012

view this page in

PharData::addEmptyDir

(PHP >= 5.3.0, PECL phar >= 2.0.0)

PharData::addEmptyDir空のディレクトリを tar/zip アーカイブに追加する

説明

bool PharData::addEmptyDir ( string $dirname )

このメソッドを使用すると、空のディレクトリが dirname に作成されます。このメソッドは ZipArchive::addEmptyDir() と同じようなものです。

パラメータ

dirname

phar アーカイブ内に作成する空のディレクトリの名前。

返り値

返り値はありません。失敗時には例外をスローします。

例1 PharData::addEmptyDir() の例

<?php
try {
    
$a = new PharData('/path/to/my.tar');

    
$a->addEmptyDir('/full/path/to/file');
    
// できあがったファイルを確認します
    
$b $a['full/path/to/file']->isDir();
} catch (
Exception $e) {
    
// ここでエラー処理をします
}
?>

参考



add a note add a note User Contributed Notes PharData::addEmptyDir
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites