ZipExtension
class ZipExtension (View source)
Transformations class
Methods
__construct(ZipArchive|null $zip = null)
No description
array
getContents(string $file, string|null $specificEntry = null)
Gets zip file contents
string|false
findFile(string $file, string $regex)
Returns the filename of the first file that matches the given $file_regexp.
int
getNumberOfFiles(string $file)
Returns the number of files in the zip archive.
string|false
extract(string $file, string $entry)
Extracts the content of $entry.
string|false
createFile(array|string $data, array|string $name)
Creates a zip file.
Details
__construct(ZipArchive|null $zip = null)
No description
array
getContents(string $file, string|null $specificEntry = null)
Gets zip file contents
string|false
findFile(string $file, string $regex)
Returns the filename of the first file that matches the given $file_regexp.
int
getNumberOfFiles(string $file)
Returns the number of files in the zip archive.
string|false
extract(string $file, string $entry)
Extracts the content of $entry.
string|false
createFile(array|string $data, array|string $name)
Creates a zip file.
If $data is an array and $name is a string, the filenames will be indexed. The function will return false if $data is a string but $name is an array or if $data is an array and $name is an array, but they don't have the same amount of elements.