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 |
---|
string
Types of encoding to accept.compress(string $raw, integer $level= 9
, string $supports= null
) : string | boolean
Supports the RFC 1951 standard.
since | 2.8 |
---|
string
String to compress.
integer
Optional, default is 9. Compression level, 9 is highest.
string
Optional, not used. When implemented it will choose the right compression based on what the server supports.
string
boolean
False on failure.content_encoding() : string
since | 2.8 |
---|
string
Content-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 |
---|
string
String to decompress.
integer
The optional length of the compressed data.
string
boolean
False 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 |
---|
boolean
should_decode(array|string $headers) : boolean
since | 2.8 |
---|
array
string
All of the available headers.
boolean