Archive: ezcArchiveV7Tar
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcArchiveV7Tar
|
The ezcArchiveV7Tar class implements the Tar v7 archive format. [
source]
ezcArchiveV7Tar is a subclass from
ezcArchive that provides the common interface. Tar v7 algorithm specific methods are implemented in this class.
ezcArchiveV7Tar reads on creation only the first
ezcArchiveEntry from the archive. When needed next entries are read.
The V7 Tar algorithm is most basic implementation of Tar. This format has the following characteristics:
- Filenames up to 100 characters.
- Stores the file permissions.
- Stores the owner and group by ID.
- Stores the last modification time.
- Can archive: regular files and symbolic links.
- Maximum file size: 8 Gygabyte.
Parents
ezcArchive
|
--ezcArchiveV7Tar
Descendents
| Child Class |
Description |
| ezcArchiveUstarTar |
The ezcArchiveUstarTar class implements the Tar ustar archive format.
|
Constants
Inherited Constants
From
ezcArchive:
Member Variables
Inherited Member Variables
From
ezcArchive:
Method Summary
|
public ezcArchiveV7Tar |
__construct(
$file, [$blockFactor = 20] )
Initializes the Tar and tries to read the first entry from the archive. |
|
public void |
__destruct(
)
|
|
public void |
algorithmCanWrite(
)
|
|
public void |
append(
$files, $prefix, $entries )
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. |
|
protected void |
appendHeaderAndFileToCurrent(
$entry, $file )
Appends the given ezcArchiveBlockFile $file and ezcArchiveEntry $entry to the archive file. |
|
protected void |
appendNullBlocks(
)
Appends zero or more null blocks to the end of the archive, so that it matches the $blockFactor. |
|
public void |
appendToCurrent(
$files, $prefix )
|
|
public void |
close(
)
|
|
protected ezcArchiveV7Header |
createTarHeader(
[$file = null] )
Creates the a new tar header for this class. |
|
public void |
getAlgorithm(
)
|
|
protected void |
readCurrentFromArchive(
)
Read the current entry from the archive. |
|
public void |
truncate(
[$fileNumber = 0] )
|
|
protected void |
writeCurrentDataToFile(
$targetPath )
|
|
public void |
writeEnd(
)
|
Inherited Methods
From
ezcArchive :
Methods
__construct
ezcArchiveV7Tar __construct(
$file, [int
$blockFactor = 20] )
Initializes the Tar and tries to read the first entry from the archive.
At initialization it sets the blockFactor to $blockFactor. Each tar archive has always $blockFactor of blocks ( 0, $blockFactor, 2 * $blockFactor, etc ).
The Tar archive works with blocks, so therefore the first parameter expects the archive as a blockFile.
Parameters
| Name |
Type |
Description |
$file |
ezcArchiveBlockFile |
|
$blockFactor |
int |
|
Redefined in descendants as
__destruct
void __destruct(
)
algorithmCanWrite
void algorithmCanWrite(
)
Redefinition of
Redefined in descendants as
append
void append(
$files,
$prefix, string|array(string)
$entries )
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.
Parameters
| Name |
Type |
Description |
$entries |
string|array(string) |
Add the files and or directories to the archive. |
$files |
|
|
$prefix |
|
|
Throws
| Class | Description |
ezcArchiveWriteException |
if one of the files cannot be written to the archive. |
ezcFileReadException |
if one of the files cannot be read from the local filesystem. |
See also:
ezcArchiveV7Tar::appendToCurrent().
Redefinition of
appendHeaderAndFileToCurrent
Appends the given ezcArchiveBlockFile $file and
ezcArchiveEntry $entry to the archive file.
The $entry will be used to create the correct header, whereas the $file contains the raw data that should be append to the archive.
Parameters
appendNullBlocks
void appendNullBlocks(
)
Appends zero or more null blocks to the end of the archive, so that it matches the $blockFactor.
If the archive has already the correct size, no null blocks will be appended. Otherwise as many null blocks are appended (up to $blockFactor - 1) so that it matches the $blockFactor.
appendToCurrent
void appendToCurrent(
$files,
$prefix )
Parameters
| Name |
Type |
Description |
$files |
|
|
$prefix |
|
|
Redefinition of
close
void close(
)
Redefinition of
createTarHeader
ezcArchiveV7Header createTarHeader(
[mixed
$file = null] )
Creates the a new tar header for this class.
Usually this class is reimplemented by other Tar algorithms, and therefore it returns another Tar header.
This method expects an ezcArchiveBlockFile that points to the header that should be read (and created). If null is given as block file, an empty header will be created.
Redefined in descendants as
getAlgorithm
void getAlgorithm(
)
Redefinition of
Redefined in descendants as
readCurrentFromArchive
void readCurrentFromArchive(
)
Read the current entry from the archive.
The current entry from the archive is read, if possible. This method will set the
$completed to true, if the end of the archive is reached. The
$entriesRead will be increased, if the entry is correctly read.
truncate
void truncate(
[
$fileNumber = 0] )
Parameters
| Name |
Type |
Description |
$fileNumber |
|
|
Redefinition of
writeCurrentDataToFile
void writeCurrentDataToFile(
$targetPath )
Parameters
| Name |
Type |
Description |
$targetPath |
|
|
Redefinition of
writeEnd
void writeEnd(
)
Last updated: Thu, 01 Nov 2007