php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
Phar Class Reference
Inheritance diagram for Phar:
RecursiveDirectoryIterator Countable ArrayAccess FilesystemIterator RecursiveIterator DirectoryIterator Iterator SplFileInfo SeekableIterator Traversable Stringable Iterator Traversable

Public Member Functions

 __construct (string $filename, int $flags=FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS, ?string $alias=null)
 
 __destruct ()
 
 addEmptyDir (string $directory)
 
 addFile (string $filename, ?string $localName=null)
 
 addFromString (string $localName, string $contents)
 
 buildFromDirectory (string $directory, string $pattern="")
 
 buildFromIterator (Traversable $iterator, ?string $baseDirectory=null)
 
 compressFiles (int $compression)
 
 decompressFiles ()
 
 compress (int $compression, ?string $extension=null)
 
 decompress (?string $extension=null)
 
 convertToExecutable (?int $format=null, ?int $compression=null, ?string $extension=null)
 
 convertToData (?int $format=null, ?int $compression=null, ?string $extension=null)
 
 copy (string $from, string $to)
 
 count (int $mode=COUNT_NORMAL)
 
 delete (string $localName)
 
 delMetadata ()
 
 extractTo (string $directory, array|string|null $files=null, bool $overwrite=false)
 
 getAlias ()
 
 getPath ()
 
 getMetadata (array $unserializeOptions=[])
 
 getModified ()
 
 getSignature ()
 
 getStub ()
 
 getVersion ()
 
 hasMetadata ()
 
 isBuffering ()
 
 isCompressed ()
 
 isFileFormat (int $format)
 
 isWritable ()
 
 offsetExists ($localName)
 
 offsetGet ($localName)
 
 offsetSet ($localName, $value)
 
 offsetUnset ($localName)
 
 setAlias (string $alias)
 
 setDefaultStub (?string $index=null, ?string $webIndex=null)
 
 setMetadata (mixed $metadata)
 
 setSignatureAlgorithm (int $algo, ?string $privateKey=null)
 
 setStub ($stub, int $length=UNKNOWN)
 
 startBuffering ()
 
 stopBuffering ()
 
- Public Member Functions inherited from RecursiveDirectoryIterator
 __construct (string $directory, int $flags=FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO)
 
 hasChildren (bool $allowLinks=false)
 
 getChildren ()
 
 getSubPath ()
 
 getSubPathname ()
 
- Public Member Functions inherited from FilesystemIterator
 rewind ()
 
 key ()
 
 current ()
 
 getFlags ()
 
 setFlags (int $flags)
 
- Public Member Functions inherited from DirectoryIterator
 __construct (string $directory)
 
 getFilename ()
 
 getExtension ()
 
 getBasename (string $suffix="")
 
 isDot ()
 
 valid ()
 
 next ()
 
 seek (int $offset)
 
 __toString ()
 
- Public Member Functions inherited from SplFileInfo
 getPathname ()
 
 getPerms ()
 
 getInode ()
 
 getSize ()
 
 getOwner ()
 
 getGroup ()
 
 getATime ()
 
 getMTime ()
 
 getCTime ()
 
 getType ()
 
 isReadable ()
 
 isExecutable ()
 
 isFile ()
 
 isDir ()
 
 isLink ()
 
 getLinkTarget ()
 
 getRealPath ()
 
 getFileInfo (?string $class=null)
 
 getPathInfo (?string $class=null)
 
 openFile (string $mode="r", bool $useIncludePath=false, $context=null)
 
 setFileClass (string $class=SplFileObject::class)
 
 setInfoClass (string $class=SplFileInfo::class)
 
 __debugInfo ()
 
 _bad_state_ex ()
 
- Public Member Functions inherited from RecursiveIterator
 hasChildren ()
 
- Public Member Functions inherited from Countable
 count ()
 
- Public Member Functions inherited from ArrayAccess
 offsetExists (mixed $offset)
 
 offsetGet (mixed $offset)
 
 offsetSet (mixed $offset, mixed $value)
 
 offsetUnset (mixed $offset)
 

Static Public Member Functions

static apiVersion ()
 
static canCompress (int $compression=0)
 
static canWrite ()
 
static createDefaultStub (?string $index=null, ?string $webIndex=null)
 
static getSupportedCompression ()
 
static getSupportedSignatures ()
 
static interceptFileFuncs ()
 
static isValidPharFilename (string $filename, bool $executable=true)
 
static loadPhar (string $filename, ?string $alias=null)
 
static mapPhar (?string $alias=null, int $offset=0)
 
static running (bool $returnPhar=true)
 
static mount (string $pharPath, string $externalPath)
 
static mungServer (array $variables)
 
static unlinkArchive (string $filename)
 
static webPhar (?string $alias=null, ?string $index=null, ?string $fileNotFoundScript=null, array $mimeTypes=[], ?callable $rewrite=null)
 

Data Fields

const int BZ2 = UNKNOWN
 
const int GZ = UNKNOWN
 
const int NONE = UNKNOWN
 
const int PHAR = UNKNOWN
 
const int TAR = UNKNOWN
 
const int ZIP = UNKNOWN
 
const int COMPRESSED = UNKNOWN
 
const int PHP = UNKNOWN
 
const int PHPS = UNKNOWN
 
const int MD5 = UNKNOWN
 
const int OPENSSL = UNKNOWN
 
const int OPENSSL_SHA256 = UNKNOWN
 
const int OPENSSL_SHA512 = UNKNOWN
 
const int SHA1 = UNKNOWN
 
const int SHA256 = UNKNOWN
 
const int SHA512 = UNKNOWN
 
- Data Fields inherited from FilesystemIterator
const int CURRENT_MODE_MASK = UNKNOWN
 
const int CURRENT_AS_PATHNAME = UNKNOWN
 
const int CURRENT_AS_FILEINFO = UNKNOWN
 
const int CURRENT_AS_SELF = UNKNOWN
 
const int KEY_MODE_MASK = UNKNOWN
 
const int KEY_AS_PATHNAME = UNKNOWN
 
const int FOLLOW_SYMLINKS = UNKNOWN
 
const int KEY_AS_FILENAME = UNKNOWN
 
const int NEW_CURRENT_AND_KEY = UNKNOWN
 
const int OTHER_MODE_MASK = UNKNOWN
 
const int SKIP_DOTS = UNKNOWN
 
const int UNIX_PATHS = UNKNOWN
 

Detailed Description

Definition at line 9 of file phar_object.stub.php.

Constructor & Destructor Documentation

◆ __construct()

Phar::__construct ( string $filename,
int $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS,
?string $alias = null )

Definition at line 76 of file phar_object.stub.php.

◆ __destruct()

Phar::__destruct ( )

Definition at line 78 of file phar_object.stub.php.

Member Function Documentation

◆ addEmptyDir()

Phar::addEmptyDir ( string $directory)

@tentative-return-type

Definition at line 81 of file phar_object.stub.php.

◆ addFile()

Phar::addFile ( string $filename,
?string $localName = null )

@tentative-return-type

Definition at line 84 of file phar_object.stub.php.

◆ addFromString()

Phar::addFromString ( string $localName,
string $contents )

@tentative-return-type

Definition at line 87 of file phar_object.stub.php.

◆ apiVersion()

static Phar::apiVersion ( )
staticfinal

Definition at line 213 of file phar_object.stub.php.

◆ buildFromDirectory()

Phar::buildFromDirectory ( string $directory,
string $pattern = "" )

@tentative-return-type

Definition at line 90 of file phar_object.stub.php.

◆ buildFromIterator()

Phar::buildFromIterator ( Traversable $iterator,
?string $baseDirectory = null )

@tentative-return-type

Definition at line 93 of file phar_object.stub.php.

◆ canCompress()

static Phar::canCompress ( int $compression = 0)
staticfinal

Definition at line 215 of file phar_object.stub.php.

◆ canWrite()

static Phar::canWrite ( )
staticfinal

Definition at line 217 of file phar_object.stub.php.

◆ compress()

Phar::compress ( int $compression,
?string $extension = null )

@tentative-return-type

Definition at line 102 of file phar_object.stub.php.

◆ compressFiles()

Phar::compressFiles ( int $compression)

@tentative-return-type

Definition at line 96 of file phar_object.stub.php.

◆ convertToData()

Phar::convertToData ( ?int $format = null,
?int $compression = null,
?string $extension = null )

@tentative-return-type

Definition at line 111 of file phar_object.stub.php.

◆ convertToExecutable()

Phar::convertToExecutable ( ?int $format = null,
?int $compression = null,
?string $extension = null )

@tentative-return-type

Definition at line 108 of file phar_object.stub.php.

◆ copy()

Phar::copy ( string $from,
string $to )

@tentative-return-type

Definition at line 114 of file phar_object.stub.php.

◆ count()

Phar::count ( int $mode = COUNT_NORMAL)

@tentative-return-type

Definition at line 117 of file phar_object.stub.php.

◆ createDefaultStub()

static Phar::createDefaultStub ( ?string $index = null,
?string $webIndex = null )
staticfinal

Definition at line 219 of file phar_object.stub.php.

◆ decompress()

Phar::decompress ( ?string $extension = null)

@tentative-return-type

Definition at line 105 of file phar_object.stub.php.

◆ decompressFiles()

Phar::decompressFiles ( )

@tentative-return-type

Definition at line 99 of file phar_object.stub.php.

◆ delete()

Phar::delete ( string $localName)

@tentative-return-type

Definition at line 120 of file phar_object.stub.php.

◆ delMetadata()

Phar::delMetadata ( )

@tentative-return-type

Definition at line 123 of file phar_object.stub.php.

◆ extractTo()

Phar::extractTo ( string $directory,
array|string|null $files = null,
bool $overwrite = false )

@tentative-return-type

Definition at line 126 of file phar_object.stub.php.

◆ getAlias()

Phar::getAlias ( )

@tentative-return-type

Definition at line 129 of file phar_object.stub.php.

◆ getMetadata()

Phar::getMetadata ( array $unserializeOptions = [])

@tentative-return-type

Definition at line 135 of file phar_object.stub.php.

◆ getModified()

Phar::getModified ( )

@tentative-return-type

Definition at line 138 of file phar_object.stub.php.

◆ getPath()

Phar::getPath ( )

@tentative-return-type

Reimplemented from SplFileInfo.

Definition at line 132 of file phar_object.stub.php.

◆ getSignature()

Phar::getSignature ( )

@tentative-return-type

Definition at line 141 of file phar_object.stub.php.

◆ getStub()

Phar::getStub ( )

@tentative-return-type

Definition at line 144 of file phar_object.stub.php.

◆ getSupportedCompression()

static Phar::getSupportedCompression ( )
staticfinal

Definition at line 221 of file phar_object.stub.php.

◆ getSupportedSignatures()

static Phar::getSupportedSignatures ( )
staticfinal

Definition at line 223 of file phar_object.stub.php.

◆ getVersion()

Phar::getVersion ( )

@tentative-return-type

Definition at line 147 of file phar_object.stub.php.

◆ hasMetadata()

Phar::hasMetadata ( )

@tentative-return-type

Definition at line 150 of file phar_object.stub.php.

◆ interceptFileFuncs()

static Phar::interceptFileFuncs ( )
staticfinal

Definition at line 225 of file phar_object.stub.php.

◆ isBuffering()

Phar::isBuffering ( )

@tentative-return-type

Definition at line 153 of file phar_object.stub.php.

◆ isCompressed()

Phar::isCompressed ( )

@tentative-return-type

Definition at line 156 of file phar_object.stub.php.

◆ isFileFormat()

Phar::isFileFormat ( int $format)

@tentative-return-type

Definition at line 159 of file phar_object.stub.php.

◆ isValidPharFilename()

static Phar::isValidPharFilename ( string $filename,
bool $executable = true )
staticfinal

Definition at line 227 of file phar_object.stub.php.

◆ isWritable()

Phar::isWritable ( )

@tentative-return-type

Reimplemented from SplFileInfo.

Definition at line 162 of file phar_object.stub.php.

◆ loadPhar()

static Phar::loadPhar ( string $filename,
?string $alias = null )
staticfinal

Definition at line 229 of file phar_object.stub.php.

◆ mapPhar()

static Phar::mapPhar ( ?string $alias = null,
int $offset = 0 )
staticfinal

Definition at line 231 of file phar_object.stub.php.

◆ mount()

static Phar::mount ( string $pharPath,
string $externalPath )
staticfinal

Definition at line 235 of file phar_object.stub.php.

◆ mungServer()

static Phar::mungServer ( array $variables)
staticfinal

Definition at line 237 of file phar_object.stub.php.

◆ offsetExists()

Phar::offsetExists ( $localName)
Parameters
string$localName@tentative-return-type

Definition at line 168 of file phar_object.stub.php.

◆ offsetGet()

Phar::offsetGet ( $localName)
Parameters
string$localName@tentative-return-type

Definition at line 174 of file phar_object.stub.php.

◆ offsetSet()

Phar::offsetSet ( $localName,
$value )
Parameters
string$localName
resource | string$value@tentative-return-type

Definition at line 181 of file phar_object.stub.php.

◆ offsetUnset()

Phar::offsetUnset ( $localName)
Parameters
string$localName@tentative-return-type

Definition at line 187 of file phar_object.stub.php.

◆ running()

static Phar::running ( bool $returnPhar = true)
staticfinal

Definition at line 233 of file phar_object.stub.php.

◆ setAlias()

Phar::setAlias ( string $alias)

@tentative-return-type

Definition at line 190 of file phar_object.stub.php.

◆ setDefaultStub()

Phar::setDefaultStub ( ?string $index = null,
?string $webIndex = null )

@tentative-return-type

Definition at line 193 of file phar_object.stub.php.

◆ setMetadata()

Phar::setMetadata ( mixed $metadata)

@tentative-return-type

Definition at line 196 of file phar_object.stub.php.

◆ setSignatureAlgorithm()

Phar::setSignatureAlgorithm ( int $algo,
?string $privateKey = null )

@tentative-return-type

Definition at line 199 of file phar_object.stub.php.

◆ setStub()

Phar::setStub ( $stub,
int $length = UNKNOWN )
Parameters
resource | string$stub@tentative-return-type

Definition at line 205 of file phar_object.stub.php.

◆ startBuffering()

Phar::startBuffering ( )

@tentative-return-type

Definition at line 208 of file phar_object.stub.php.

◆ stopBuffering()

Phar::stopBuffering ( )

@tentative-return-type

Definition at line 211 of file phar_object.stub.php.

◆ unlinkArchive()

static Phar::unlinkArchive ( string $filename)
staticfinal

Definition at line 239 of file phar_object.stub.php.

◆ webPhar()

static Phar::webPhar ( ?string $alias = null,
?string $index = null,
?string $fileNotFoundScript = null,
array $mimeTypes = [],
?callable $rewrite = null )
staticfinal

Definition at line 241 of file phar_object.stub.php.

Field Documentation

◆ BZ2

const int Phar::BZ2 = UNKNOWN

@cvalue PHAR_ENT_COMPRESSED_BZ2

Definition at line 14 of file phar_object.stub.php.

◆ COMPRESSED

const int Phar::COMPRESSED = UNKNOWN

@cvalue PHAR_ENT_COMPRESSION_MASK

Definition at line 38 of file phar_object.stub.php.

◆ GZ

const int Phar::GZ = UNKNOWN

@cvalue PHAR_ENT_COMPRESSED_GZ

Definition at line 18 of file phar_object.stub.php.

◆ MD5

const int Phar::MD5 = UNKNOWN

@cvalue PHAR_SIG_MD5

Definition at line 50 of file phar_object.stub.php.

◆ NONE

const int Phar::NONE = UNKNOWN

@cvalue PHAR_ENT_COMPRESSED_NONE

Definition at line 22 of file phar_object.stub.php.

◆ OPENSSL

const int Phar::OPENSSL = UNKNOWN

@cvalue PHAR_SIG_OPENSSL

Definition at line 54 of file phar_object.stub.php.

◆ OPENSSL_SHA256

const int Phar::OPENSSL_SHA256 = UNKNOWN

@cvalue PHAR_SIG_OPENSSL_SHA256

Definition at line 58 of file phar_object.stub.php.

◆ OPENSSL_SHA512

const int Phar::OPENSSL_SHA512 = UNKNOWN

@cvalue PHAR_SIG_OPENSSL_SHA512

Definition at line 62 of file phar_object.stub.php.

◆ PHAR

const int Phar::PHAR = UNKNOWN

@cvalue PHAR_FORMAT_PHAR

Definition at line 26 of file phar_object.stub.php.

◆ PHP

const int Phar::PHP = UNKNOWN

@cvalue PHAR_MIME_PHP

Definition at line 42 of file phar_object.stub.php.

◆ PHPS

const int Phar::PHPS = UNKNOWN

@cvalue PHAR_MIME_PHPS

Definition at line 46 of file phar_object.stub.php.

◆ SHA1

const int Phar::SHA1 = UNKNOWN

@cvalue PHAR_SIG_SHA1

Definition at line 66 of file phar_object.stub.php.

◆ SHA256

const int Phar::SHA256 = UNKNOWN

@cvalue PHAR_SIG_SHA256

Definition at line 70 of file phar_object.stub.php.

◆ SHA512

const int Phar::SHA512 = UNKNOWN

@cvalue PHAR_SIG_SHA512

Definition at line 74 of file phar_object.stub.php.

◆ TAR

const int Phar::TAR = UNKNOWN

@cvalue PHAR_FORMAT_TAR

Definition at line 30 of file phar_object.stub.php.

◆ ZIP

const int Phar::ZIP = UNKNOWN

@cvalue PHAR_FORMAT_ZIP

Definition at line 34 of file phar_object.stub.php.


The documentation for this class was generated from the following file: