PHP Phar archive stream and classes Functions
EditRocket provides the following information on Phar archive stream and classes functions in the PHP source code builder.
string Phar::apiVersion ( void ) - Return the API version of the phar file format that will be used when creating phars. The Phar extension supports reading API version 1.0.0 or newer.
bool Phar::canCompress ([ int $type ] ) - This should be used to test whether compression is possible prior to loading a phar archive containing compressed files.
bool Phar::canWrite ( void ) - This method determines whether write access has been disabled in the system php.
bool Phar->compressAllFilesBZIP2 ( void ) - This method compresses all files in the Phar archive using bzip2 compression.
bool Phar->compressAllFilesGZ ( void ) - This method compresses all files in the Phar archive using gzip compression.
void Phar::__construct ( string $fname [, int $flags [, string $alias ]] ) -
int Phar->count ( void ) -
int Phar->getMetaData ( void ) -
bool Phar->getModified ( void ) - This method can be used to determine whether a phar has either had an internal file deleted, or contents of a file changed in some way.
array Phar->getSignature ( void ) - Returns the verification signature of a phar archive in a hexadecimal string.
string Phar->getStub ( void ) - One of the features that differentiates a Phar archive from other familiar archive formats like tar or zip is that a Phar archive is explicitly designed to be included to allow distributing an application or library that can be run without extraction directly from the archive. In order to accomplish this, Phar archives contain a bootstrap loader, or stub written in PHP that can perform any action.
string Phar->getVersion ( void ) - Returns the API version of an opened Phar archive.
bool Phar->isBuffering ( void ) -
mixed Phar::loadPhar ( string $filename [, string $alias ] ) - This can be used to read the contents of an external Phar archive. This is most useful for assigning an alias to a phar so that subsequent references to the phar can use the shorter alias, or for loading Phar archives that only contain data and are not intended for execution/inclusion in PHP scripts.
mixed Phar::mapPhar ([ string $alias [, int $dataoffset ]] ) - This static method can only be used inside a Phar archive's loader stub in order to initialize the phar when it is directly executed, or when it is included in another script.
bool Phar::offsetExists ( string $offset ) - This is an implementation of the ArrayAccess interface allowing direct manipulation of the contents of a Phar archive using array access brackets.
int Phar::offsetGet ( string $offset ) - This is an implementation of the ArrayAccess interface allowing direct manipulation of the contents of a Phar archive using array access brackets. offsetGet is used for retrieving files from a Phar archive.
void Phar::offsetSet ( string $offset , string $value ) - This is an implementation of the ArrayAccess interface allowing direct manipulation of the contents of a Phar archive using array access brackets. offsetSet is used for modifying an existing file, or adding a new file to a Phar archive.
bool Phar::offsetUnset ( string $offset ) - This is an implementation of the ArrayAccess interface allowing direct manipulation of the contents of a Phar archive using array access brackets.
void Phar->setMetaData ( mixed $metadata ) - setMetaData() should only be used to store customized data that describes something about the phar archive as a complete entity.
void Phar->setStub ( string $stub ) - This method is used to add a PHP bootstrap loader stub to a new Phar archive, or to replace the loader stub in an existing Phar archive.
void Phar->startBuffering ( void ) - Although technically unnecessary, the startBuffering() method can provide a significant performance boost when creating or modifying a Phar archive with a large number of files. Ordinarily, every time a file within a Phar archive is created or modified in any way, the entire Phar archive will be recreated with the changes. In this way, the archive will be up-to-date with the activity performed on it.
void Phar->stopBuffering ( void ) - stopBuffering() is used in conjunction with the startBuffering() method. startBuffering() can provide a significant performance boost when creating or modifying a Phar archive with a large number of files. Ordinarily, every time a file within a Phar archive is created or modified in any way, the entire Phar archive will be recreated with the changes. In this way, the archive will be up-to-date with the activity performed on it.
bool Phar->uncompressAllFiles ( void ) - This method decompresses all files in the Phar archive.
void PharFileInfo->chmod ( int $permissions ) - PharFileInfo->chmod() allows setting of the executable file permissions bit, as well as read-only bits.
void PharFileInfo::__construct ( string $entry ) - This should not be called directly.
int PharFileInfo->getPharFlags ( void ) - This returns the flags set in the manifest for a Phar. This will always return 0 in the current implementation.
int PharFileInfo->getCompressedSize ( void ) - This returns the size of the file within the Phar archive.
int PharFileInfo->getCRC32 ( void ) -
int PharFileInfo->getMetaData ( void ) - Return meta-data that was saved in the Phar archive's manifest for this file.
bool PharFileInfo->isCompressed ( void ) - This returns whether a file is compressed within a Phar archive with either Gzip or Bzip2 compression.
bool PharFileInfo->isCompressedBZIP2 ( void ) - This returns whether a file is compressed within a Phar archive with Bzip2 compression.
bool PharFileInfo->isCompressedGZ ( void ) - This returns whether a file is compressed within a Phar archive with Gzip compression.
bool PharFileInfo->isCRCChecked ( void ) - This returns whether a file within a Phar archive has had its CRC verified.
bool PharFileInfo->setCompressedBZIP2 ( void ) - This method compresses the file inside the Phar archive using bzip2 compression.
bool PharFileInfo->setCompressedGZ ( void ) - This method compresses the file inside the Phar archive using gzip compression.
void PharFileInfo->setMetaData ( mixed $metadata ) - setMetaData() should only be used to store customized data in a file that cannot be represented with existing information stored with a file. Meta-data can significantly slow down the performance of loading a phar archive if the data is large, or if there are many files containing meta-data.
bool PharFileInfo->setUncompressed ( void ) - This method decompresses the file inside the Phar archive.