Phar
PHP Manual

The PharData class

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

简介

The PharData class provides a high-level interface to accessing and creating non-executable tar and zip archives. Because these archives do not contain a stub and cannot be executed by the phar extension, it is possible to create and manipulate regular zip and tar files using the PharData class even if phar.readonly php.ini setting is 1.

类摘要

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

Table of Contents


Phar
PHP Manual