Phar::webPhar
PharData::buildFromIterator
Phar
PHP Manual

# The PharData class

## Introduction

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.

## Class synopsis

PharData
class PharData extends Phar {
/* Properties */
/* Methods */
array buildFromIterator ( Iterator `$iter` [, string `$base_directory` ] )
bool compressAllFilesBZIP2 ( void )
bool compressAllFilesGZ ( void )
void __construct ( string `$fname` [, int `$flags` ] )
bool convertToPhar ( string `$extension` )
bool convertToTar ( string `$extension` )
bool convertToZip ( string `$extension` )
bool copy ( string `$oldfile` , string `$newfile` )
int delMetadata ( void )
void offsetSet ( string `$offset` , string `$value` )
bool setAlias ( string `$alias` )
void setStub ( string `$stub` )
/* Inherited methods */
string Phar::apiVersion ( void )
array Phar::buildFromIterator ( Iterator `$iter` [, string `$base_directory` ] )
bool Phar::canCompress ([ int `$type` ] )
bool Phar::canWrite ( void )
object Phar::compress ( int `$compression` )
bool Phar::compressAllFilesBZIP2 ( void )
bool Phar::compressAllFilesGZ ( void )
void Phar::__construct ( string `$fname` [, int `$flags` [, string `$alias` ]] )
bool Phar::convertToPhar ( string `$extension` )
bool Phar::convertToTar ( int `$compression` )
bool Phar::convertToZip ( void )
bool Phar::copy ( string `$oldfile` , string `$newfile` )
int Phar::count ( void )
string Phar::createDefaultStub ( void )
int Phar::delMetadata ( void )
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 )
bool|int Phar::isCompressed ( void )
bool Phar::isPhar ( void )
bool Phar::isTar ( void )
bool Phar::isValidPharFilename ( string `$filename` )
bool Phar::isZip ( void )
mixed Phar::loadPhar ( string `$filename` [, string `$alias` ] )
mixed Phar::mapPhar ([ string `$alias` [, int `$dataoffset` ]] )
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::setAlias ( string `$alias` )
void Phar::setMetadata ( mixed `$metadata` )
array Phar::setSignatureAlgorithm ( int `$sigtype` )
void Phar::setStub ( string `$stub` )
void Phar::startBuffering ( void )
void Phar::stopBuffering ( void )
bool Phar::uncompressAllFiles ( void )
void Phar::webPhar ( string `$alias` , string `$index` , string `$f404` , array `$mimetypes` , array `$rewrites` )
}

## Table of Contents

- PharData::buildFromIterator — Construct a tar or zip archive from an iterator.
- PharData::compressAllFilesBZIP2 — Compresses all files in the current tar/zip archive using Bzip2 compression
- PharData::compressAllFilesGZ — Compresses all files in the current tar/zip archive using Gzip compression
- PharData::__construct — Construct a non-executable tar or zip archive object
- PharData::convertToPhar — Convert the tar/zip archive to the phar file format
- PharData::convertToTar — Convert a zip archive to the tar file format
- PharData::convertToZip — Convert a tar archive to the zip file format
- PharData::copy — Copy a file internal to the phar archive to another new file within the phar
- PharData::delMetadata — Deletes the global metadata of a zip archive
- PharData::offsetSet — set the contents of a file within the tar/zip to those of an external file or string
- PharData::setAlias — dummy function (Phar::setAlias is not valid for PharData)
- PharData::setStub — dummy function (Phar::setStub is not valid for PharData)

Phar::webPhar
PharData::buildFromIterator
Phar
PHP Manual