\PhpZip\ModelZipEntry

ZIP file entry.

Summary

Methods
Properties
Constants
__construct()
setCharset()
getCharset()
getName()
getPlatform()
setPlatform()
getCreatedOS()
setCreatedOS()
getExtractedOS()
setExtractedOS()
getSoftwareVersion()
setSoftwareVersion()
getVersionNeededToExtract()
getExtractVersion()
setVersionNeededToExtract()
setExtractVersion()
getCompressedSize()
getSize()
getUncompressedSize()
getLocalHeaderOffset()
getOffset()
getGeneralPurposeBitFlags()
isDataDescriptorEnabled()
enableDataDescriptor()
enableUtf8Name()
isUtf8Flag()
isEncrypted()
isStrongEncryption()
disableEncryption()
getMethod()
getCompressionMethod()
setMethod()
setCompressionMethod()
getTime()
getDosTime()
setDosTime()
setTime()
getExternalAttributes()
setExternalAttributes()
getInternalAttributes()
setInternalAttributes()
isDirectory()
getCdExtraFields()
getCdExtraField()
setCdExtraFields()
getLocalExtraFields()
getLocalExtraField()
setLocalExtraFields()
getExtraField()
hasExtraField()
removeExtraField()
addExtraField()
addLocalExtraField()
addCdExtraField()
getComment()
setComment()
isDataDescriptorRequired()
getCrc()
getPassword()
setPassword()
getEncryptionMethod()
setEncryptionMethod()
getCompressionLevel()
setCompressionLevel()
setUnixMode()
getUnixMode()
isZip64ExtensionsRequired()
isUnixSymlink()
getMTime()
getATime()
getCTime()
__clone()
No public properties found
UNKNOWN
PLATFORM_FAT
PLATFORM_UNIX
PLATFORM_OS_X
METHOD_WINZIP_AES
No protected methods found
$cdExtraFields
$localExtraFields
N/A
setName()
updateCompressionLevel()
setGeneralBitFlag()
isSetGeneralBitFlag()
setEncrypted()
updateGbpfCompLevel()
$name
$isDirectory
$data
$createdOS
$extractedOS
$softwareVersion
$extractVersion
$compressionMethod
$generalPurposeBitFlags
$dosTime
$crc
$compressedSize
$uncompressedSize
$internalAttributes
$externalAttributes
$localHeaderOffset
$comment
$password
$encryptionMethod
$compressionLevel
$charset
N/A

Constants

UNKNOWN

UNKNOWN = -1 : int

PLATFORM_FAT

PLATFORM_FAT = \PhpZip\Constants\ZipPlatform::OS_DOS : int

PLATFORM_UNIX

PLATFORM_UNIX = \PhpZip\Constants\ZipPlatform::OS_UNIX : int

PLATFORM_OS_X

PLATFORM_OS_X = \PhpZip\Constants\ZipPlatform::OS_MAC_OSX : int

METHOD_WINZIP_AES

METHOD_WINZIP_AES = \PhpZip\Constants\ZipCompressionMethod::WINZIP_AES

Pseudo compression method for WinZip AES encrypted entries.

Require php extension openssl or mcrypt.

Properties

$cdExtraFields

$cdExtraFields : \PhpZip\Model\Extra\ExtraFieldsCollection

Collections of Extra Fields in Central Directory.

Keys from Header ID [int] and value Extra Field [ExtraField].

Type

ExtraFieldsCollection

$localExtraFields

$localExtraFields : \PhpZip\Model\Extra\ExtraFieldsCollection

Collections of Extra Fields int local header.

Keys from Header ID [int] and value Extra Field [ExtraField].

Type

ExtraFieldsCollection

$name

$name : string

Type

string — Entry name (filename in archive)

$isDirectory

$isDirectory : bool

Type

bool — Is directory

$data

$data : \PhpZip\Model\ZipData|null

Type

ZipData|null — Zip entry contents

$createdOS

$createdOS : int

Type

int — Made by platform

$extractedOS

$extractedOS : int

Type

int — Extracted by platform

$softwareVersion

$softwareVersion : int

Type

int — Software version

$extractVersion

$extractVersion : int

Type

int — Version needed to extract

$compressionMethod

$compressionMethod : int

Type

int — Compression method

$generalPurposeBitFlags

$generalPurposeBitFlags : int

Type

int — General purpose bit flags

$dosTime

$dosTime : int

Type

int — Dos time

$crc

$crc : int

Type

int — Crc32

$compressedSize

$compressedSize : int

Type

int — Compressed size

$uncompressedSize

$uncompressedSize : int

Type

int — Uncompressed size

$internalAttributes

$internalAttributes : int

Type

int — Internal attributes

$externalAttributes

$externalAttributes : int

Type

int — External attributes

$localHeaderOffset

$localHeaderOffset : int

Type

int — relative Offset Of Local File Header

$comment

$comment : string|null

Type

string|null — comment field

$password

$password : string|null

Type

string|null — entry password for read or write encryption data

$encryptionMethod

$encryptionMethod : int

Type

int — encryption method

$compressionLevel

$compressionLevel : int

Type

int

Methods

__construct()

__construct(string  $name, string|null  $charset = null) : mixed

ZipEntry constructor.

Parameters

string $name

Entry name

string|null $charset

DOS charset

Returns

mixed —

setCharset()

setCharset(string|null  $charset = null) : \PhpZip\Model\ZipEntry

Parameters

string|null $charset

Returns

\PhpZip\Model\ZipEntry —

getCharset()

getCharset() : string|null

Returns

string|null —

getName()

getName() : string

Returns the ZIP entry name.

Returns

string —

getPlatform()

getPlatform() : int

Returns

int —

Get platform

setPlatform()

setPlatform(int  $platform) : \PhpZip\Model\ZipEntry

Parameters

int $platform

Returns

\PhpZip\Model\ZipEntry —

getCreatedOS()

getCreatedOS() : int

Returns

int —

platform

setCreatedOS()

setCreatedOS(int  $platform) : \PhpZip\Model\ZipEntry

Set platform.

Parameters

int $platform

Returns

\PhpZip\Model\ZipEntry —

getExtractedOS()

getExtractedOS() : int

Returns

int —

setExtractedOS()

setExtractedOS(int  $platform) : \PhpZip\Model\ZipEntry

Set extracted OS.

Parameters

int $platform

Returns

\PhpZip\Model\ZipEntry —

getSoftwareVersion()

getSoftwareVersion() : int

Returns

int —

setSoftwareVersion()

setSoftwareVersion(int  $softwareVersion) : \PhpZip\Model\ZipEntry

Parameters

int $softwareVersion

Returns

\PhpZip\Model\ZipEntry —

getVersionNeededToExtract()

getVersionNeededToExtract() : int

Version needed to extract.

Returns

int —

getExtractVersion()

getExtractVersion() : int

Version needed to extract.

Returns

int —

setVersionNeededToExtract()

setVersionNeededToExtract(int  $version) : \PhpZip\Model\ZipEntry

Set version needed to extract.

Parameters

int $version

Returns

\PhpZip\Model\ZipEntry —

setExtractVersion()

setExtractVersion(int  $version) : \PhpZip\Model\ZipEntry

Set version needed to extract.

Parameters

int $version

Returns

\PhpZip\Model\ZipEntry —

getCompressedSize()

getCompressedSize() : int

Returns the compressed size of this entry.

Returns

int —

getSize()

getSize() : int

Returns the uncompressed size of this entry.

Returns

int —

getUncompressedSize()

getUncompressedSize() : int

Returns the uncompressed size of this entry.

Returns

int —

getLocalHeaderOffset()

getLocalHeaderOffset() : int

Return relative Offset Of Local File Header.

Returns

int —

getOffset()

getOffset() : int

Return relative Offset Of Local File Header.

Returns

int —

getGeneralPurposeBitFlags()

getGeneralPurposeBitFlags() : int

Returns the General Purpose Bit Flags.

Returns

int —

isDataDescriptorEnabled()

isDataDescriptorEnabled() : bool

Returns

bool —

enableDataDescriptor()

enableDataDescriptor(bool  $enabled = true) : mixed

Enabling or disabling the use of the Data Descriptor block.

Parameters

bool $enabled

Returns

mixed —

enableUtf8Name()

enableUtf8Name(bool  $enabled) : mixed

Parameters

bool $enabled

Returns

mixed —

isUtf8Flag()

isUtf8Flag() : bool

Returns

bool —

isEncrypted()

isEncrypted() : bool

Returns true if and only if this ZIP entry is encrypted.

Returns

bool —

isStrongEncryption()

isStrongEncryption() : bool

Returns

bool —

disableEncryption()

disableEncryption() : \PhpZip\Model\ZipEntry

Sets the encryption property to false and removes any other encryption artifacts.

Returns

\PhpZip\Model\ZipEntry —

getMethod()

getMethod() : int

Returns the compression method for this entry.

Returns

int —

getCompressionMethod()

getCompressionMethod() : int

Returns the compression method for this entry.

Returns

int —

setMethod()

setMethod(int  $method) : \PhpZip\Model\ZipEntry

Sets the compression method for this entry.

Parameters

int $method

Throws

\PhpZip\Exception\ZipUnsupportMethodException

Returns

\PhpZip\Model\ZipEntry —

setCompressionMethod()

setCompressionMethod(int  $compressionMethod) : \PhpZip\Model\ZipEntry

Sets the compression method for this entry.

Parameters

int $compressionMethod

Throws

\PhpZip\Exception\ZipUnsupportMethodException

Returns

\PhpZip\Model\ZipEntry —

getTime()

getTime() : int

Get Unix Timestamp.

Returns

int —

getDosTime()

getDosTime() : int

Get Dos Time.

Returns

int —

setDosTime()

setDosTime(int  $dosTime) : \PhpZip\Model\ZipEntry

Set Dos Time.

Parameters

int $dosTime

Returns

\PhpZip\Model\ZipEntry —

setTime()

setTime(int  $unixTimestamp) : \PhpZip\Model\ZipEntry

Set time from unix timestamp.

Parameters

int $unixTimestamp

Returns

\PhpZip\Model\ZipEntry —

getExternalAttributes()

getExternalAttributes() : int

Returns the external file attributes.

Returns

int —

the external file attributes

setExternalAttributes()

setExternalAttributes(int  $externalAttributes) : \PhpZip\Model\ZipEntry

Sets the external file attributes.

Parameters

int $externalAttributes

the external file attributes

Returns

\PhpZip\Model\ZipEntry —

getInternalAttributes()

getInternalAttributes() : int

Returns the internal file attributes.

Returns

int —

the internal file attributes

setInternalAttributes()

setInternalAttributes(int  $internalAttributes) : \PhpZip\Model\ZipEntry

Sets the internal file attributes.

Parameters

int $internalAttributes

the internal file attributes

Returns

\PhpZip\Model\ZipEntry —

isDirectory()

isDirectory() : bool

Returns true if and only if this ZIP entry represents a directory entry (i.e. end with '/').

Returns

bool —

getCdExtraFields()

getCdExtraFields() : \PhpZip\Model\Extra\ExtraFieldsCollection

Returns

\PhpZip\Model\Extra\ExtraFieldsCollection —

getCdExtraField()

getCdExtraField(int  $headerId) : \PhpZip\Model\Extra\ZipExtraField|null

Parameters

int $headerId

Returns

\PhpZip\Model\Extra\ZipExtraField|null —

setCdExtraFields()

setCdExtraFields(\PhpZip\Model\Extra\ExtraFieldsCollection  $cdExtraFields) : \PhpZip\Model\ZipEntry

Parameters

\PhpZip\Model\Extra\ExtraFieldsCollection $cdExtraFields

Returns

\PhpZip\Model\ZipEntry —

getLocalExtraFields()

getLocalExtraFields() : \PhpZip\Model\Extra\ExtraFieldsCollection

Returns

\PhpZip\Model\Extra\ExtraFieldsCollection —

getLocalExtraField()

getLocalExtraField(int  $headerId) : \PhpZip\Model\Extra\ZipExtraField|null

Parameters

int $headerId

Returns

\PhpZip\Model\Extra\ZipExtraField|null —

setLocalExtraFields()

setLocalExtraFields(\PhpZip\Model\Extra\ExtraFieldsCollection  $localExtraFields) : \PhpZip\Model\ZipEntry

Parameters

\PhpZip\Model\Extra\ExtraFieldsCollection $localExtraFields

Returns

\PhpZip\Model\ZipEntry —

getExtraField()

getExtraField(int  $headerId) : \PhpZip\Model\Extra\ZipExtraField|null

Parameters

int $headerId

Returns

\PhpZip\Model\Extra\ZipExtraField|null —

hasExtraField()

hasExtraField(int  $headerId) : bool

Parameters

int $headerId

Returns

bool —

removeExtraField()

removeExtraField(int  $headerId) : mixed

Parameters

int $headerId

Returns

mixed —

addExtraField()

addExtraField(\PhpZip\Model\Extra\ZipExtraField  $zipExtraField) : mixed

Parameters

\PhpZip\Model\Extra\ZipExtraField $zipExtraField

Returns

mixed —

addLocalExtraField()

addLocalExtraField(\PhpZip\Model\Extra\ZipExtraField  $zipExtraField) : mixed

Parameters

\PhpZip\Model\Extra\ZipExtraField $zipExtraField

Returns

mixed —

addCdExtraField()

addCdExtraField(\PhpZip\Model\Extra\ZipExtraField  $zipExtraField) : mixed

Parameters

\PhpZip\Model\Extra\ZipExtraField $zipExtraField

Returns

mixed —

getComment()

getComment() : string

Returns comment entry.

Returns

string —

setComment()

setComment(string|null  $comment) : \PhpZip\Model\ZipEntry

Set entry comment.

Parameters

string|null $comment

Returns

\PhpZip\Model\ZipEntry —

isDataDescriptorRequired()

isDataDescriptorRequired() : bool

Returns

bool —

getCrc()

getCrc() : int

Return crc32 content or 0 for WinZip AES v2.

Returns

int —

getPassword()

getPassword() : string|null

Returns

string|null —

setPassword()

setPassword(string|null  $password, int|null  $encryptionMethod = null) : \PhpZip\Model\ZipEntry

Set password and encryption method from entry.

Parameters

string|null $password
int|null $encryptionMethod

Returns

\PhpZip\Model\ZipEntry —

getEncryptionMethod()

getEncryptionMethod() : int

Returns

int —

setEncryptionMethod()

setEncryptionMethod(int|null  $encryptionMethod) : \PhpZip\Model\ZipEntry

Set encryption method.

Parameters

int|null $encryptionMethod

Returns

\PhpZip\Model\ZipEntry —

getCompressionLevel()

getCompressionLevel() : int

Returns

int —

setCompressionLevel()

setCompressionLevel(int  $compressionLevel) : \PhpZip\Model\ZipEntry

Parameters

int $compressionLevel

Returns

\PhpZip\Model\ZipEntry —

setUnixMode()

setUnixMode(int  $mode) : \PhpZip\Model\ZipEntry

Sets Unix permissions in a way that is understood by Info-Zip's unzip command.

Parameters

int $mode

mode an int value

Returns

\PhpZip\Model\ZipEntry —

getUnixMode()

getUnixMode() : int

Unix permission.

Returns

int —

the unix permissions

isZip64ExtensionsRequired()

isZip64ExtensionsRequired() : bool

Offset MUST be considered in decision about ZIP64 format - see description of Data Descriptor in ZIP File Format Specification.

Returns

bool —

isUnixSymlink()

isUnixSymlink() : bool

Returns true if this entry represents a unix symlink, in which case the entry's content contains the target path for the symlink.

Returns

bool —

true if the entry represents a unix symlink, false otherwise

getMTime()

getMTime() : \DateTimeInterface

Returns

\DateTimeInterface —

getATime()

getATime() : \DateTimeInterface|null

Returns

\DateTimeInterface|null —

getCTime()

getCTime() : \DateTimeInterface|null

Returns

\DateTimeInterface|null —

__clone()

__clone() : mixed

Returns

mixed —

setName()

setName(string  $name, string|null  $charset = null) : \PhpZip\Model\ZipEntry

Set entry name.

Parameters

string $name

New entry name

string|null $charset

Returns

\PhpZip\Model\ZipEntry —

updateCompressionLevel()

updateCompressionLevel() : mixed

Returns

mixed —

setGeneralBitFlag()

setGeneralBitFlag(int  $mask, bool  $enable) : \PhpZip\Model\ZipEntry

Parameters

int $mask
bool $enable

Returns

\PhpZip\Model\ZipEntry —

isSetGeneralBitFlag()

isSetGeneralBitFlag(int  $mask) : bool

Parameters

int $mask

Returns

bool —

setEncrypted()

setEncrypted(bool  $encrypted) : \PhpZip\Model\ZipEntry

Sets the encryption flag for this ZIP entry.

Parameters

bool $encrypted

Returns

\PhpZip\Model\ZipEntry —

updateGbpfCompLevel()

updateGbpfCompLevel() : mixed

Update general purpose bit flogs.

Returns

mixed —