trait MakesZipArchives

Methods

makeZip(array$files,string$path)

Create a ZIP archive as a report.

string
sanitizeFilename(string$name,string$extension)

Sanitizes a filename.

Details

at line22
protected makeZip(array$files,string$path)

Create a ZIP archive as a report.

This function will create a ZIP archive at $this->availableReport->path.

Parameters

array $files Array of files, with source path as keys and target filenames (in the ZIP) as values.
string $path Path to the file to store the generated ZIP to

Exceptions

Exception If the ZIP file could not be created.

at line48
protectedstring sanitizeFilename(string$name,string$extension)

Sanitizes a filename.

Parameters

string $name Filename to sanitize
string $extension File extension to use (since dots are sanitized, too)

Return Value

string