The PharData class

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

简介

The PharData class provides a high-level interface to accessing and creating non-executable tar and zip archives. Because these archives do not contain a stub and cannot be executed by the phar extension, it is possible to create and manipulate regular zip and tar files using the PharData class even if phar.readonly php.ini setting is 1.

类摘要

PharData extends RecursiveDirectoryIterator implements Countable , ArrayAccess {
/* 继承的常量 */
const int FilesystemIterator::SKIP_DOTS = 4096 ;
const int FilesystemIterator::UNIX_PATHS = 8192 ;
/* 方法 */
public __construct ( string $filename , int $flags = FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS , string|null $alias = null , int $format = 0 )
public addEmptyDir ( string $directory ) : void
public addFile ( string $filename , string|null $localName = null ) : void
public addFromString ( string $localName , string $contents ) : void
public buildFromDirectory ( string $directory , string $pattern = "" ) : array|false
public buildFromIterator ( Traversable $iterator , string|null $baseDirectory = null ) : array|false
public compress ( int $compression , string|null $extension = null ) : Phar|null
public compressFiles ( int $compression ) : void
public convertToData ( int|null $format = null , int|null $compression = null , string|null $extension = null ) : Phar|null
public convertToExecutable ( int|null $format = null , int|null $compression = null , string|null $extension = null ) : Phar|null
public copy ( string $to , string $from ) : bool
public decompress ( string|null $extension = null ) : Phar|null
public decompressFiles ( ) : bool
public delMetadata ( ) : bool
public delete ( string $localName ) : bool
public extractTo ( string $directory , array|string|null $files = null , bool $overwrite = false ) : bool
public isWritable ( ) : bool
public offsetSet ( string $localName , resource|string $value ) : void
public offsetUnset ( string $localName ) : bool
public setAlias ( string $alias ) : bool
public setDefaultStub ( string|null $index = null , string|null $webIndex = null ) : bool
public setMetadata ( mixed $metadata ) : void
public setSignatureAlgorithm ( int $algo , string|null $privateKey = null ) : void
public setStub ( string $stub , int $len = -1 ) : bool
}

Table of Contents

User Contributed Notes

There are no user contributed notes for this page.
PHP8中文手册 站长在线 整理 版权归PHP文档组所有