Phar Signature format
Phar::apiVersion
Phar
PHP Manual

# The Phar class

## Introduction

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

## Class synopsis

Phar
class Phar extends DirectoryIterator implements Countable , ArrayAccess {
/* Properties */
/* Methods */
string apiVersion ( void )
array buildFromIterator ( Iterator `$iter` [, string `$base_directory` ] )
bool canCompress ([ int `$type` ] )
bool canWrite ( void )
object compress ( int `$compression` )
bool compressAllFilesBZIP2 ( void )
bool compressAllFilesGZ ( void )
void __construct ( string `$fname` [, int `$flags` [, string `$alias` ]] )
bool convertToPhar ( string `$extension` )
bool convertToTar ( int `$compression` )
bool convertToZip ( void )
bool copy ( string `$oldfile` , string `$newfile` )
int count ( void )
string createDefaultStub ( void )
int delMetadata ( void )
int getMetaData ( void )
bool getModified ( void )
array getSignature ( void )
string getStub ( void )
array getSupportedCompression ( void )
array getSupportedSignatures ( void )
string getVersion ( void )
int hasMetadata ( void )
void interceptFileFuncs ( void )
bool isBuffering ( void )
bool|int isCompressed ( void )
bool isPhar ( void )
bool isTar ( void )
bool isValidPharFilename ( string `$filename` )
bool isZip ( void )
mixed loadPhar ( string `$filename` [, string `$alias` ] )
mixed mapPhar ([ string `$alias` [, int `$dataoffset` ]] )
void mungServer ( array `$munglist` )
bool offsetExists ( string `$offset` )
int offsetGet ( string `$offset` )
void offsetSet ( string `$offset` , string `$value` )
bool offsetUnset ( string `$offset` )
bool setAlias ( string `$alias` )
void setMetadata ( mixed `$metadata` )
array setSignatureAlgorithm ( int `$sigtype` )
void setStub ( string `$stub` )
void startBuffering ( void )
void stopBuffering ( void )
bool uncompressAllFiles ( void )
void webPhar ( string `$alias` , string `$index` , string `$f404` , array `$mimetypes` , array `$rewrites` )
}

## Table of Contents

- Phar::apiVersion — Returns the api version
- Phar::buildFromIterator — Construct a phar archive from an iterator.
- Phar::canCompress — Returns whether phar extension supports compression using either zlib or bzip2
- Phar::canWrite — Returns whether phar extension supports writing and creating phars
- Phar::compress — Compresses the entire Phar archive using Gzip or Bzip2 compression
- Phar::compressAllFilesBZIP2 — Compresses all files in the current Phar archive using Bzip2 compression
- Phar::compressAllFilesGZ — Compresses all files in the current Phar archive using Gzip compression
- Phar::__construct — Construct a Phar archive object
- Phar::convertToPhar — Convert the phar archive to the phar file format
- Phar::convertToTar — Convert the phar archive to the tar file format, optionally compressing the entire archive using gzip or bzip2 compression
- Phar::convertToZip — Convert the phar archive to the zip file format
- Phar::copy — Copy a file internal to the phar archive to another new file within the phar
- Phar::count — Returns the number of entries (files) in the Phar archive
- Phar::createDefaultStub — Return the PHP loader or bootstrap stub of a Phar archive
- Phar::delMetadata — Deletes the global metadata of the phar
- Phar::getMetaData — Returns phar archive meta-data
- Phar::getModified — Return whether phar was modified
- Phar::getSignature — Return MD5/SHA1/SHA256/SHA512 signature of a Phar archive
- Phar::getStub — Return the PHP loader or bootstrap stub of a Phar archive
- Phar::getSupportedCompression — Return array of supported compression algorithms
- Phar::getSupportedSignatures — Return array of supported signature types
- Phar::getVersion — Return version info of Phar archive
- Phar::hasMetaData — Returns whether phar has global meta-data
- Phar::interceptFileFuncs — instructs phar to intercept fopen, file_get_contents, opendir, and all of the stat-related functions
- Phar::isBuffering — Used to determine whether Phar write operations are being buffered, or are flushing directly to disk
- Phar::isCompressed — Returns Phar::GZ or PHAR::BZ2 if the entire phar archive is compressed (.tar.gz/tar.bz and so on)
- Phar::isPhar — Returns true if the phar archive is based on the phar file format
- Phar::isTar — Returns true if the phar archive is based on the tar file format
- Phar::isValidPharFilename — Returns whether the given filename is a valid phar filename
- Phar::isZip — Returns true if the phar archive is based on the Zip file format
- Phar::loadPhar — Loads any phar archive with an alias
- Phar::mapPhar — Reads the currently executed file (a phar) and registers its manifest
- Phar::mungServer — Defines a list of up to 4 $_SERVER variables that should be modified for execution
- Phar::offsetExists — determines whether a file exists in the phar
- Phar::offsetGet — get a PharFileInfo object for a specific file
- Phar::offsetSet — set the contents of an internal file to those of an external file
- Phar::offsetUnset — remove a file from a phar
- Phar::setAlias — Set the alias for the Phar archive
- Phar::setMetadata — Sets phar archive meta-data
- Phar::setSignatureAlgorithm — set the signature algorithm for a phar and apply it. The
- Phar::setStub — Used to set the PHP loader or bootstrap stub of a Phar archive
- Phar::startBuffering — Start buffering Phar write operations, do not modify the Phar object on disk
- Phar::stopBuffering — Stop buffering write requests to the Phar archive, and save changes to disk
- Phar::uncompressAllFiles — Uncompresses all files in the current Phar archive
- Phar::webPhar — mapPhar for web-based phars. front controller for web applications

Phar Signature format
Phar::apiVersion
Phar
PHP Manual