gzipFile.php
Table of Contents
Functions
- gzipFile() : string
- Compresses a single file with gzip (DEFLATE), streaming it in chunks.
Functions
gzipFile()
Compresses a single file with gzip (DEFLATE), streaming it in chunks.
gzipFile(string $source[, string|null $destination = null ][, int $level = -1 ][, bool $overwrite = true ]) : string
Standalone gzip compression outside of tar archives, using the zlib
extension — no subprocess, and the file is never fully loaded into memory.
Parameters
- $source : string
-
Path to the file to compress.
- $destination : string|null = null
-
Output path. Defaults to
$source+.gz. - $level : int = -1
-
Compression level
0–9, or-1for zlib's default (default:-1). - $overwrite : bool = true
-
Whether to overwrite an existing destination (default:
true).
Tags
Return values
string —The destination path.