Implementation for deflate and gzip transfer encodings.
Includes RFC 1950, RFC 1951, and RFC 1952.
| since | 2.8 |
|---|---|
| package | WordPress |
| subpackage | HTTP |
accept_encoding() : string
| since | 2.8 |
|---|
stringTypes of encoding to accept.compress(string $raw, integer $level= 9, string $supports= null) : string | boolean
Supports the RFC 1951 standard.
| since | 2.8 |
|---|
stringString to compress.
integerOptional, default is 9. Compression level, 9 is highest.
stringOptional, not used. When implemented it will choose the right compression based on what the server supports.
stringbooleanFalse on failure.content_encoding() : string
| since | 2.8 |
|---|
stringContent-Encoding string to send in the header.decompress(string $compressed, integer $length = null) : string | boolean
Will attempt to decompress using the RFC 1950 standard, and if that fails then the RFC 1951 standard deflate will be attempted. Finally, the RFC 1952 standard gzip decode will be attempted. If all fail, then the original compressed string will be returned.
| since | 2.8 |
|---|
stringString to decompress.
integerThe optional length of the compressed data.
stringbooleanFalse on failure.is_available() : boolean
Each function is tested instead of checking for the zlib extension, to ensure that the functions all exist in the PHP version and aren't disabled.
| since | 2.8 |
|---|
booleanshould_decode(array|string $headers) : boolean
| since | 2.8 |
|---|
arraystringAll of the available headers.
boolean