ZipManager
in package
Multiple ZipArchive manager
Tags
Table of Contents
- $zip_archives : array<string|int, mixed>
- Array of managed zip files
- add() : ZipManager
- Add a file to zip
- addZip() : ZipManager
- Add a \Coodojo\Zip\Zip object to manager
- close() : bool
- Close Zips
- delete() : ZipManager
- Delete a file from Zips
- extract() : bool
- Extract Zips to common destination
- getMask() : array<string|int, mixed>
- Get a list of masks from Zips
- getPath() : array<string|int, mixed>
- Get a list of paths used by Zips
- getZip() : Zip
- Get a a \Coodojo\Zip\Zip object
- listFiles() : array<string|int, mixed>
- Get a list of files in Zips
- listZips() : array<string|int, mixed>
- Get a list of managed Zips
- merge() : bool
- Merge multiple Zips into one
- removeZip() : ZipManager
- Remove a \Coodojo\Zip\Zip object from manager
- setMask() : ZipManager
- Set default file mask for all Zips
- setPath() : ZipManager
- Set current base path (just to add relative files to zip archive) for all zip files
- getTemporaryFolder() : mixed
- recursiveUnlink() : mixed
- removeExtension() : mixed|string
Properties
$zip_archives
Array of managed zip files
private
array<string|int, mixed>
$zip_archives
= []
Methods
add()
Add a file to zip
public
add(mixed $file_name_or_array[, bool $flatten_root_folder = false ]) : ZipManager
Parameters
- $file_name_or_array : mixed
-
filename to add or an array of filenames
- $flatten_root_folder : bool = false
-
in case of directory, specify if root folder should be flatten or not
Return values
ZipManager —addZip()
Add a \Coodojo\Zip\Zip object to manager
public
addZip(Zip $zip) : ZipManager
Parameters
- $zip : Zip
Return values
ZipManager —close()
Close Zips
public
close() : bool
Return values
bool —delete()
Delete a file from Zips
public
delete(mixed $file_name_or_array) : ZipManager
Parameters
- $file_name_or_array : mixed
-
filename to add or an array of filenames
Return values
ZipManager —extract()
Extract Zips to common destination
public
extract(string $destination[, bool $separate = true ][, array<string|int, mixed> $files = null ]) : bool
Parameters
- $destination : string
-
Destination path
- $separate : bool = true
-
Specify if files should be placed in different directories
- $files : array<string|int, mixed> = null
-
Array of files to extract
Return values
bool —getMask()
Get a list of masks from Zips
public
getMask() : array<string|int, mixed>
Return values
array<string|int, mixed> —getPath()
Get a list of paths used by Zips
public
getPath() : array<string|int, mixed>
Return values
array<string|int, mixed> —getZip()
Get a a \Coodojo\Zip\Zip object
public
getZip(int $zipId) : Zip
Parameters
- $zipId : int
-
The zip id from self::listZips()
Return values
Zip —listFiles()
Get a list of files in Zips
public
listFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —listZips()
Get a list of managed Zips
public
listZips() : array<string|int, mixed>
Return values
array<string|int, mixed> —merge()
Merge multiple Zips into one
public
merge(string $output_zip_file[, bool $separate = true ]) : bool
Parameters
- $output_zip_file : string
-
Destination zip
- $separate : bool = true
-
Specify if files should be placed in different directories
Return values
bool —removeZip()
Remove a \Coodojo\Zip\Zip object from manager
public
removeZip(Zip $zip) : ZipManager
Parameters
- $zip : Zip
Return values
ZipManager —setMask()
Set default file mask for all Zips
public
setMask(int $mask) : ZipManager
Parameters
- $mask : int
Return values
ZipManager —setPath()
Set current base path (just to add relative files to zip archive) for all zip files
public
setPath(string $path) : ZipManager
Parameters
- $path : string
Return values
ZipManager —getTemporaryFolder()
private
static getTemporaryFolder() : mixed
Return values
mixed —recursiveUnlink()
private
static recursiveUnlink(string $folder) : mixed
Parameters
- $folder : string
Return values
mixed —removeExtension()
private
static removeExtension( $filename) : mixed|string