\App\CoreModule\ModelsZipArchiveManager

Tool for creating a new zip archive

Summary

Methods
Properties
Constants
__construct()
addFileFromText()
addFolder()
addFile()
addJsonFromArray()
exist()
extract()
listFiles()
openFile()
close()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(  path,   flags = \ZipArchive::CREATE | \ZipArchive::OVERWRITE) : 

Constructor

Parameters

path

Path of a new zip archive

flags

The mode to use to open the archive

Returns

addFileFromText()

addFileFromText(  filename,   content) : 

Add a file to the ZIP archive using its contents

Parameters

filename

File name

content

The content of text file

Returns

addFolder()

addFolder(  path,   folderName) : 

Add a folder to the ZIP archive from the given path

Parameters

path

The path to the folder to add

folderName

Folder name in the archive

Returns

addFile()

addFile(  path,   filename) : 

Add a file to a ZIP archive from the given path

Parameters

path

The path to the file to add

filename

File name in the archive

Returns

addJsonFromArray()

addJsonFromArray(  filename, mixed||string|int  jsonData) : 

Add a JSON file to the ZIP archive using its contents

Parameters

filename

File name

mixed||string|int jsonData

JSON data in an array

Throws

\App\CoreModule\Models\JsonException

Returns

exist()

exist(string|array|\App\CoreModule\Models\ArrayHash  var) : 

Check if the file or the files exist in the archive

Parameters

string|array|\App\CoreModule\Models\ArrayHash var

File(s) to check

Returns

Is file exist

extract()

extract(  destinationPath) : 

Extract the archive contents

Parameters

destinationPath

Path to location where to extract the files

Returns

listFiles()

listFiles() : mixed||string|int

List files in the archive

Returns

mixed||string|int —

List of files in the archive

openFile()

openFile(  fileName) : 

Open file in the archive

Parameters

fileName

File name

Returns

Content of file

close()

close() : 

Close the active archive

Returns