W3cubDocs

/PHP

The Phar class

Introduction

(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 1.0.0)

The Phar class provides a high-level interface to accessing and creating phar archives.

Class synopsis

Phar extends RecursiveDirectoryIterator implements Countable , ArrayAccess {
/* Inherited constants */
const int FilesystemIterator::SKIP_DOTS = 4096 ;
const int FilesystemIterator::UNIX_PATHS = 8192 ;
/* Methods */
public addEmptyDir ( string $dirname ) : void
public addFile ( string $file [, string $localname ] ) : void
public addFromString ( string $localname , string $contents ) : void
final public static apiVersion ( ) : string
public buildFromDirectory ( string $base_dir [, string $regex ] ) : array
public buildFromIterator ( Iterator $iter [, string $base_directory ] ) : array
final public static canCompress ([ int $type = 0 ] ) : bool
final public static canWrite ( ) : bool
public compress ( int $compression [, string $extension ] ) : Phar
public compressFiles ( int $compression ) : void
public __construct ( string $fname [, int $flags [, string $alias ]] )
public convertToData ([ int $format = 9021976 [, int $compression = 9021976 [, string $extension ]]] ) : PharData
public convertToExecutable ([ int $format = 9021976 [, int $compression = 9021976 [, string $extension ]]] ) : Phar
public copy ( string $oldfile , string $newfile ) : bool
public count ( ) : int
final public static createDefaultStub ([ string $indexfile [, string $webindexfile ]] ) : string
public decompress ([ string $extension ] ) : Phar
public decompressFiles ( ) : bool
public delMetadata ( ) : bool
public delete ( string $entry ) : bool
public extractTo ( string $pathto [, string|array|null $files = null [, bool $overwrite = false ]] ) : bool
public getAlias ( ) : string
public getMetadata ( ) : mixed
public getModified ( ) : bool
public getPath ( ) : string
public getSignature ( ) : array
public getStub ( ) : string
final public static getSupportedCompression ( ) : array
final public static getSupportedSignatures ( ) : array
public getVersion ( ) : string
public hasMetadata ( ) : bool
final public static interceptFileFuncs ( ) : void
public isBuffering ( ) : bool
public isCompressed ( ) : mixed
public isFileFormat ( int $format ) : bool
final public static isValidPharFilename ( string $filename [, bool $executable = true ] ) : bool
public isWritable ( ) : bool
final public static loadPhar ( string $filename [, string $alias ] ) : bool
final public static mapPhar ([ string $alias [, int $dataoffset = 0 ]] ) : bool
final public static mount ( string $pharpath , string $externalpath ) : void
final public static mungServer ( array $munglist ) : void
public offsetExists ( string $offset ) : bool
public offsetGet ( string $offset ) : PharFileInfo
public offsetSet ( string $offset , string $value ) : void
public offsetUnset ( string $offset ) : bool
final public static running ([ bool $retphar = true ] ) : string
public setAlias ( string $alias ) : bool
public setDefaultStub ([ string $index [, string $webindex ]] ) : bool
public setMetadata ( mixed $metadata ) : void
public setSignatureAlgorithm ( int $sigtype [, string $privatekey ] ) : void
public setStub ( string $stub [, int $len = -1 ] ) : bool
public startBuffering ( ) : void
public stopBuffering ( ) : void
final public static unlinkArchive ( string $archive ) : bool
final public static webPhar ([ string $alias [, string $index = "index.php" [, string $f404 [, array $mimetypes [, callable $rewrites ]]]]] ) : void
}

Table of Contents

© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.phar.php