Archive
in package
Table of Contents
- GzCompressFile() : Result
- GZIPs a file on disk (appending .gz to the name)
- Unzip() : Result
- Unzip a file
- Zip() : Result
- Create a zip archive from folder or file contents
Methods
GzCompressFile()
GZIPs a file on disk (appending .gz to the name)
public
static GzCompressFile(string $source[, int $level = 9 ][, bool $clean = true ], int|float|string $suffix) : Result
From http://stackoverflow.com/questions/6073397/how-do-you-create-a-gz-file-using-php Based on function: http://www.php.net/manual/en/function.gzwrite.php#34955
Parameters
- $source : string
-
Path to file that should be compressed
- $level : int = 9
-
GZIP compression level (default: 9)
- $clean : bool = true
-
Clean source file after compression (default: true)
- $suffix : int|float|string
-
Additional suffix for the target
Return values
Result —A default system result object
Unzip()
Unzip a file
public
static Unzip(string $file[, string|null $target = null ][, bool $chunks = false ]) : Result
Take the archive, unzip it and place the results in the defined folder or an automated one
Parameters
- $file : string
-
Absolute path to file
- $target : string|null = null
-
The output folder or, null for dynamic one
- $chunks : bool = false
Return values
Result —The unzip result
Zip()
Create a zip archive from folder or file contents
public
static Zip(string $source, string $target) : Result
Parameters
- $source : string
- $target : string