Path

ez components / documentation / api reference / 1.1.1 / archive


eZ Components 1.1.1

Archive: ezcArchiveUstarTar

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

Class: ezcArchiveUstarTar

The ezcArchiveUstarTar class implements the Tar ustar archive format. [source]

Implemented Interfaces

  • Iterator (internal interface)

ezcArchiveUstarTar is a subclass from ezcArchive that provides the common interface, and ezcArchiveV7Tar that provides the basic Tar implementation.
ezcArchiveUstarTar reads on creation only the first entry from the archive. When needed next entries are read.
The Ustar Tar algorithm is an extension of V7 Tar. Ustar has the following extended features:
  • Filenames up to 255 characters.
  • Stores the owner and group by ID and Name.
  • Can archive: regular files, symbolic links, hard links, fifo's, and devices.

Parents

ezcArchive
   |
   --ezcArchiveV7Tar
      |
      --ezcArchiveUstarTar

Descendents

Child Class Description
ezcArchivePaxTar The ezcArchivePaxTar class implements the Tar pax or posix archive format.
ezcArchiveGnuTar The ezcArchiveGnuTar class implements the GNU Tar archive format.

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 ezcArchiveUstarTar __construct( $blockFile, [$blockFactor = 20] )
public void algorithmCanWrite( )
protected void createTarHeader( [$file = null] )
public void getAlgorithm( )

Inherited Methods

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

ezcArchiveUstarTar __construct( $blockFile, [ $blockFactor = 20] )

Parameters

Name Type Description
$blockFile ezcArchiveBlockFile  
$blockFactor  

Redefinition of

Method Description
ezcArchiveV7Tar::__construct() Initializes the Tar and tries to read the first entry from the archive.

Redefined in descendants as

Method Description
ezcArchivePaxTar::__construct()  
ezcArchiveGnuTar::__construct()  

algorithmCanWrite

void algorithmCanWrite( )

Redefinition of

Method Description
ezcArchiveV7Tar::algorithmCanWrite()  

Redefined in descendants as

Method Description
ezcArchivePaxTar::algorithmCanWrite()  
ezcArchiveGnuTar::algorithmCanWrite()  

createTarHeader

void createTarHeader( [ $file = null] )

Parameters

Name Type Description
$file  

Redefinition of

Method Description
ezcArchiveV7Tar::createTarHeader() Creates the a new tar header for this class.

Redefined in descendants as

Method Description
ezcArchivePaxTar::createTarHeader()  
ezcArchiveGnuTar::createTarHeader()  

getAlgorithm

void getAlgorithm( )

Redefinition of

Method Description
ezcArchiveV7Tar::getAlgorithm()  

Redefined in descendants as

Method Description
ezcArchivePaxTar::getAlgorithm()  
ezcArchiveGnuTar::getAlgorithm()  

Last updated: Thu, 01 Nov 2007