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
}
?>
기타
- Phar :: addEmptyDir() - phar 아카이브에 빈 디렉토리 추가
- PharData::addFile() - 파일 시스템에서 tar/zip 아카이브로 파일 추가
- PharData::addFromString() - 파일 시스템의 파일을 tar/zip 아카이브에 추가합니다.