HttpCompressor
class HttpCompressor (View source)
The HttpCompressor class to support gzip encoding.
Constants
ENCODING_GZIP |
|
ENCODING_XGZIP |
|
ENCODING_DEFLATE |
|
Methods
Compressor constructor.
Method to check zlib supported.
Checks the accept encoding of the browser and compresses the data before sending it to the client if possible.
Compress raw data.
Method to get property AcceptEncoding
Method to set property acceptEncoding
Method to check to see if headers have already been sent.
Method to check the current client connection status to ensure that it is alive.
Method to get property EncodedBy
Method to set property encodedBy
Details
at line line 53
__construct(string $acceptEncoding = null)
Compressor constructor.
at line line 63
static boolean
isSupported()
Method to check zlib supported.
at line line 90
ResponseInterface
compress(ResponseInterface $response)
Checks the accept encoding of the browser and compresses the data before sending it to the client if possible.
at line line 152
string
encode(string $data, int $encoding = FORCE_GZIP, int $level = 4)
Compress raw data.
at line line 182
string
getAcceptEncoding()
Method to get property AcceptEncoding
at line line 199
HttpCompressor
setAcceptEncoding(string $acceptEncoding)
Method to set property acceptEncoding
at line line 215
boolean
checkHeadersSent()
Method to check to see if headers have already been sent.
We wrap headers_sent() function with this method for testing reason.
at line line 229
boolean
checkConnectionAlive()
Method to check the current client connection status to ensure that it is alive.
We wrap connection_status() function with this method for testing reason.
at line line 239
string
getEncodedBy()
Method to get property EncodedBy
at line line 251
HttpCompressor
setEncodedBy(string $encodedBy)
Method to set property encodedBy