Phar Signature format
Phar::addEmptyDir
Phar
PHP Manual
The Phar class
Introduction
The Phar class provides a high-level interface to accessing and creating phar archives.
Class synopsis
Phar
Phar
extends
DirectoryIterator
implements
Countable
,
ArrayAccess
{
/* Properties */
/* Methods */
bool
Phar::addEmptyDir
(
string
$dirname
)
bool
Phar::addFile
(
string
$file
[,
string
$localname
] )
bool
Phar::addFromString
(
string
$localname
,
string
$contents
)
string
Phar::apiVersion
(
void
)
array
Phar::buildFromDirectory
(
string
$base_dir
[,
string
$regex
] )
array
Phar::buildFromIterator
(
Iterator
$iter
[,
string
$base_directory
] )
bool
Phar::canCompress
([
int
$type
] )
bool
Phar::canWrite
(
void
)
object
Phar::compress
(
int
$compression
[,
string
$extension
] )
bool
Phar::compressAllFilesBZIP2
(
void
)
bool
Phar::compressAllFilesGZ
(
void
)
bool
Phar::compressFiles
(
int
$compression
)
void
Phar::__construct
(
string
$fname
[,
int
$flags
[,
string
$alias
]] )
PharData
Phar::convertToData
([
int
$format
[,
int
$compression
[,
string
$extension
]]] )
Phar
Phar::convertToExecutable
([
int
$format
[,
int
$compression
[,
string
$extension
]]] )
bool
Phar::copy
(
string
$oldfile
,
string
$newfile
)
int
Phar::count
(
void
)
string
Phar::createDefaultStub
(
void
)
object
Phar::decompress
([
string
$extension
] )
bool
Phar::decompressFiles
(
void
)
int
Phar::delMetadata
(
void
)
int
Phar::delete
(
string
$entry
)
int
Phar::extractTo
(
string
$pathto
[,
string|array
$files
[,
bool
$overwrite
]] )
int
Phar::getMetaData
(
void
)
bool
Phar::getModified
(
void
)
array
Phar::getSignature
(
void
)
string
Phar::getStub
(
void
)
array
Phar::getSupportedCompression
(
void
)
array
Phar::getSupportedSignatures
(
void
)
string
Phar::getVersion
(
void
)
int
Phar::hasMetadata
(
void
)
void
Phar::interceptFileFuncs
(
void
)
bool
Phar::isBuffering
(
void
)
mixed
Phar::isCompressed
(
void
)
bool
Phar::isFileFormat
(
int
$format
)
bool
Phar::isValidPharFilename
(
string
$filename
[,
bool
$executable
] )
bool
Phar::isWritable
(
void
)
mixed
Phar::loadPhar
(
string
$filename
[,
string
$alias
] )
mixed
Phar::mapPhar
([
string
$alias
[,
int
$dataoffset
]] )
void
Phar::mount
(
string
$pharpath
,
string
$externalpath
)
void
Phar::mungServer
(
array
$munglist
)
bool
Phar::offsetExists
(
string
$offset
)
int
Phar::offsetGet
(
string
$offset
)
void
Phar::offsetSet
(
string
$offset
,
string
$value
)
bool
Phar::offsetUnset
(
string
$offset
)
bool
Phar::running
([
bool
$retphar
] )
bool
Phar::setAlias
(
string
$alias
)
void
Phar::setDefaultStub
([
string
$index
[,
string
$webindex
]] )
void
Phar::setMetadata
(
mixed
$metadata
)
array
Phar::setSignatureAlgorithm
(
int
$sigtype
[,
string
$privatekey
] )
void
Phar::setStub
(
string
$stub
)
void
Phar::startBuffering
(
void
)
void
Phar::stopBuffering
(
void
)
bool
Phar::uncompressAllFiles
(
void
)
bool
Phar::unlinkArchive
(
string
$archive
)
void
Phar::webPhar
(
string
$alias
,
string
$index
,
string
$f404
,
array
$mimetypes
,
array
$rewrites
)
}
Table of Contents
Phar::addEmptyDir
— Add an empty directory to the phar archive
Phar::addFile
— Add a file from the filesystem to the phar archive
Phar::addFromString
— Add a file from the filesystem to the phar archive
Phar::apiVersion
— Returns the api version
Phar::buildFromDirectory
— Construct a phar archive from the files within a directory.
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::compressFiles
— Compresses all files in the current Phar archive
Phar::__construct
— Construct a Phar archive object
Phar::convertToData
— Convert a phar archive to a non-executable tar or zip file
Phar::convertToExecutable
— Convert a phar archive to another executable phar archive 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::decompress
— Decompresses the entire Phar archive
Phar::decompressFiles
— Decompresses all files in the current Phar archive
Phar::delMetadata
— Deletes the global metadata of the phar
Phar::delete
— Delete a file within a phar archive
Phar::extractTo
— Extract the contents of a phar archive to a directory
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::isFileFormat
— Returns true if the phar archive is based on the tar/phar/zip file format depending on the parameter
Phar::isValidPharFilename
— Returns whether the given filename is a valid phar filename
Phar::isWritable
— Returns true if the phar archive can be modified
Phar::loadPhar
— Loads any phar archive with an alias
Phar::mapPhar
— Reads the currently executed file (a phar) and registers its manifest
Phar::mount
— Mount an external path or file to a virtual location within the phar archive
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::running
— Returns the full path on disk or full phar URL to the currently executing Phar archive
Phar::setAlias
— Set the alias for the Phar archive
Phar::setDefaultStub
— Used to set the PHP loader or bootstrap stub of a Phar archive to the default loader
Phar::setMetadata
— Sets phar archive meta-data
Phar::setSignatureAlgorithm
— set the signature algorithm for a phar and apply it.
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::unlinkArchive
— Completely remove a phar archive from disk and from memory
Phar::webPhar
— mapPhar for web-based phars. front controller for web applications
Phar Signature format
Phar::addEmptyDir
Phar
PHP Manual