ZipEdit
ZipEdit class allows to edit zip files on the fly and stream them afterwards
- Full name:
\SebLucas\EPubMeta\Tools\ZipEdit
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
DOWNLOAD |
public | 1 | |
NOHEADER |
public | 4 | |
FILE |
public | 8 | |
STRING |
public | 32 | |
MIME_TYPE |
public | 'application/epub+zip' |
Properties
mZip
mEntries
mChanges
mFileName
mSaveMe
Methods
__construct
__destruct
Destructor
Open
Open a zip file and read it's entries
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | |
$inFlags |
int|null |
Return Value:
True if zip file has been correctly opended, else false
FileExists
Check if a file exist in the zip entries
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | File to search |
Return Value:
True if the file exist, else false
FileRead
Read the content of a file in the zip entries
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | File to search |
Return Value:
File content the file exist, else false
FileStream
Get a file handler to a file in the zip entries (read-only)
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | File to search |
Return Value:
File handler if the file exist, else false
FileAdd
Summary of FileAdd
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | |
$inData |
mixed |
FileAddPath
Summary of FileAddPath
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | |
$inFilePath |
string |
FileDelete
Summary of FileDelete
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string |
FileReplace
Replace the content of a file in the zip entries
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | File with content to replace |
$inData |
string|bool | Data content to replace, or false to delete |
FileGetState
Return the state of the file.
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
mixed |
Return Value:
'u'=unchanged, 'm'=modified, 'd'=deleted, 'a'=added, false=unknown
FileCancelModif
Summary of FileCancelModif
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | |
$ReplacedAndDeleted |
bool |
Close
Close the zip file
Throws:
SaveBeforeClose
Summary of SaveBeforeClose
Flush
Summary of Flush
public Flush(mixed $render = self::DOWNLOAD, mixed $outFileName = '', mixed $contentType = '', bool $sendHeaders = true, resource|null $outFileStream = null): void
Parameters:
Parameter | Type | Description |
---|---|---|
$render |
mixed | |
$outFileName |
mixed | |
$contentType |
mixed | |
$sendHeaders |
bool | |
$outFileStream |
resource|null |
copyTest
Summary of copyTest
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$inFileName |
string | |
$outFileName |
string |
Automatically generated on 2025-03-18