Path

ez components / documentation / api reference / 1.0.1 / archive


eZ Components 1.0.1

Archive: ezcArchiveGnuTar

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcArchiveGnuTar

The ezcArchiveGnuTar class implements the GNU Tar archive format. [source]
ezcArchiveGnuTar is a subclass from ezcArchive that provides the common interface, and ezcArchiveUstarTar that provides the basic Tar implementation.
ezcArchiveGnuTar reads on creation only the first entry from the archive. When needed next entries are read.
The Gnu Tar algorithm is an extension of Ustar Tar. Gnu has the following extended features compared to Ustar:
  • Filenames of unlimited size.
  • File size is unlimited.
The current implementation allows only reading from a Gnu archive.
The features of Gnu Tar and Pax Tar are quite similar, although their approach is different.

Parents

ezcArchive
   |
   --ezcArchiveV7Tar
      |
      --ezcArchiveUstarTar
         |
         --ezcArchiveGnuTar

Inherited Constants

From ezcArchiveV7Tar:
ezcArchiveV7Tar::BLOCK_SIZE    Amount of bytes in a block.
From ezcArchive:
ezcArchive::BZIP2    BZIP2 compression format.
ezcArchive::GZIP    Gnu ZIP compression format.
ezcArchive::TAR    Normal tar archive.
ezcArchive::TAR_GNU    GNU tar archive.
ezcArchive::TAR_PAX    PAX tar archive.
ezcArchive::TAR_USTAR    USTAR tar archive.
ezcArchive::TAR_V7    Tar version 7 archive.
ezcArchive::ZIP    ZIP archive.

Inherited Member Variables

From ezcArchiveV7Tar:
protected  ezcArchiveV7Tar::$blockFactor
protected  ezcArchiveV7Tar::$headerPositions
protected  ezcArchiveV7Tar::$headers
From ezcArchive:
protected  ezcArchive::$completed
protected  ezcArchive::$entries
protected  ezcArchive::$entriesRead
protected  ezcArchive::$file
protected  ezcArchive::$fileNumber

Method Summary

public ezcArchiveGnuTar __construct( $file, [$blockFactor = 20] )
public void algorithmCanWrite( )
protected void createTarHeader( [$file = null] )
public void getAlgorithm( )

Inherited Methods

From ezcArchiveUstarTar :
public ezcArchiveUstarTar ezcArchiveUstarTar::__construct()
public void ezcArchiveUstarTar::algorithmCanWrite()
protected void ezcArchiveUstarTar::createTarHeader()
public void ezcArchiveUstarTar::getAlgorithm()
From ezcArchiveV7Tar :
public ezcArchiveV7Tar ezcArchiveV7Tar::__construct()
Initializes the Tar and tries to read the first entry from the archive.
public void ezcArchiveV7Tar::algorithmCanWrite()
protected void ezcArchiveV7Tar::appendHeaderAndFileToCurrent()
Appends the given ezcArchiveBlockFile $file and ezcArchiveEntry $entry to the archive file.
protected void ezcArchiveV7Tar::appendNullBlocks()
Appends zero or more null blocks to the end of the archive, so that it matches the $blockFactor.
public void ezcArchiveV7Tar::appendToCurrent()
protected ezcArchiveV7Header ezcArchiveV7Tar::createTarHeader()
Creates the a new tar header for this class.
public void ezcArchiveV7Tar::getAlgorithm()
public void ezcArchiveV7Tar::readCurrentFromArchive()
Read the current entry from the archive.
public void ezcArchiveV7Tar::truncate()
protected void ezcArchiveV7Tar::writeCurrentDataToFile()
From ezcArchive :
public abstract bool ezcArchive::algorithmCanWrite()
Returns true if writing to the archive is implemented, otherwise false.
public void ezcArchive::append()
Append a file or directory to the end of the archive. Multiple files or directory can be added to the archive when an array is used as input parameter.
public abstract void ezcArchive::appendToCurrent()
Appends a file to the archive after the current entry.
protected void ezcArchive::createDefaultDirectory()
Creates all the directories needed to create the file $file.
protected static ezcArchive ezcArchive::createInstance()
Returns an instance of the archive with the given type.
public ezcArchiveEntry ezcArchive::current()
Returns the current ezcArchiveEntry if it is valid, otherwise false is returned.
public void ezcArchive::extract()
Extract entries from the archive to the target directory.
public bool ezcArchive::extractCurrent()
Extract the current entry to which the iterator points.
public abstract int ezcArchive::getAlgorithm()
Returns the algorithm that is used currently.
public array(string) ezcArchive::getListing()
Returns an array that lists the content of the archive.
public static ezcArchive ezcArchive::getTarInstance()
Open a tar instance.
public static ezcArchive ezcArchive::getZipInstance()
Open a zip instance. This method is made public for testing purposes, and should not be used.
public bool ezcArchive::isEmpty()
Returns true if the current archive is empty, otherwise false.
public bool ezcArchive::isWritable()
Returns true if it is possible to write to the archive, otherwise false.
public int ezcArchive::key()
Returns the current key, entry number, if it is valid, otherwise false is returned.
public ezcArchiveEntry ezcArchive::next()
Forwards the iterator to the next entry.
public static ezcArchive ezcArchive::open()
Returns a new ezcArchive instance.
public void ezcArchive::rewind()
Rewinds the iterator to the first entry.
public bool ezcArchive::seek()
Search for the entry number.
public abstract void ezcArchive::truncate()
Truncate the archive to $fileNumber of files.
public bool ezcArchive::valid()
Returns true if the iterator points to a valid entry, otherwise false.
protected abstract void ezcArchive::writeCurrentDataToFile()
Writes the file data from the current entry to the given file.
public mixed ezcArchive::__get()
Returns the property $name.
public void ezcArchive::__set()
Sets the property $name to $value.
public string ezcArchive::__toString()
Returns a string which represents all the entries from the archive.

Methods

__construct

ezcArchiveGnuTar __construct( $file, [ $blockFactor = 20] )

Parameters

Name Type Description
$file ezcArchiveBlockFile  
$blockFactor  

Redefinition of

Method Description
ezcArchiveUstarTar::__construct()  

algorithmCanWrite

void algorithmCanWrite( )

Redefinition of

Method Description
ezcArchiveUstarTar::algorithmCanWrite()  

createTarHeader

void createTarHeader( [ $file = null] )

Parameters

Name Type Description
$file  

Redefinition of

Method Description
ezcArchiveUstarTar::createTarHeader()  

getAlgorithm

void getAlgorithm( )

Redefinition of

Method Description
ezcArchiveUstarTar::getAlgorithm()  

Last updated: Fri, 02 Nov 2007