TYPO3CMS
9.5
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
$
d
e
r
u
Functions
Variables
$
e
r
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
CompressionUtility.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Frontend\Utility
;
3
4
/*
5
* This file is part of the TYPO3 CMS project.
6
*
7
* It is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU General Public License, either version 2
9
* of the License, or any later version.
10
*
11
* For the full copyright and license information, please read the
12
* LICENSE.txt file that was distributed with this source code.
13
*
14
* The TYPO3 project - inspiring people to share!
15
*/
16
23
class
CompressionUtility
implements
\TYPO3\CMS\Core\SingletonInterface
24
{
32
protected
$contentLength
= 0;
33
44
public
function
compressionOutputHandler
($outputBuffer, $mode)
45
{
46
// Compress the content
47
$outputBuffer = ob_gzhandler($outputBuffer, $mode);
48
if
($outputBuffer !==
false
) {
49
// Save compressed size
50
$this->contentLength += strlen($outputBuffer);
51
// Check if this was the last content chunk
52
if
(0 != ($mode & PHP_OUTPUT_HANDLER_END)) {
53
// Check if we have content-length header
54
foreach
(headers_list() as $header) {
55
if
(0 == strncasecmp(
'Content-length:'
, $header, 15)) {
56
header(
'Content-length: '
. $this->contentLength);
57
break
;
58
}
59
}
60
}
61
}
62
return
$outputBuffer;
63
}
64
}
TYPO3\CMS\Frontend\Utility\CompressionUtility
Definition:
CompressionUtility.php:24
TYPO3\CMS\Frontend\Utility
Definition:
CanonicalizationUtility.php:4
TYPO3\CMS\Frontend\Utility\CompressionUtility\$contentLength
int $contentLength
Definition:
CompressionUtility.php:31
TYPO3\CMS\Frontend\Utility\CompressionUtility\compressionOutputHandler
string compressionOutputHandler($outputBuffer, $mode)
Definition:
CompressionUtility.php:43
TYPO3\CMS\Core\SingletonInterface
Definition:
SingletonInterface.php:22
doxygen
typo3
sysext
frontend
Classes
Utility
CompressionUtility.php
Generated on Tue Oct 5 2021 01:57:45 for TYPO3CMS by
1.8.18