Phar
PHP Manual

Phar::addEmptyDir

(Unknown)

Phar::addEmptyDirAdd an empty directory to the phar archive

Описание

void Phar::addEmptyDir ( string $dirname )

Забележка: Този метод изисква стойността на phar.readonly в php.ini да бъде 0, за да работи за обекти Phar. В противен случай ще бъде хвърлено PharException.

With this method, an empty directory is created with path dirname. This method is similar to ZipArchive::addEmptyDir().

Параметри

dirname

The name of the empty directory to create in the phar archive

Връщани стойности

no return value, exception is thrown on failure.

Примери

Example #1 A Phar::addEmptyDir() example

<?php
try {
    
$a = new Phar('/path/to/phar.phar');

    
$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
PHP Manual