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 line 22
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

at line 48
protected string 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