PharData::addEmptyDir

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL phar >= 2.0.0)

PharData::addEmptyDir — tar/zip 아카이브에 빈 디렉토리 추가


설명

public PharData::addEmptyDir(string $directory): void

이 메서드를 사용하면 경로가 dirname인 빈 디렉터리가 생성됩니다. 이 메서드는 ZipArchive::addEmptyDir()와 유사합니다.


매개변수

directory
phar 아카이브에 생성할 빈 디렉토리의 이름

반환 값

반환 값이 없으며 실패 시 예외가 발생합니다.


Examples

예제 #1 PharData::addEmptyDir() 예제

                  
<?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
}
?>
                  
                

기타