38 $s = self::mangleFlashPolicy(
$s );
41 if ( !defined(
'MW_NO_OUTPUT_COMPRESSION' ) ) {
42 $s = self::handleGzip(
$s );
44 if ( !
ini_get(
'output_handler' ) ) {
45 self::emitContentLength(
strlen(
$s ) );
63 if (
isset( $_SERVER[
'REQUEST_URI'] ) ) {
65 list( $path ) = explode(
'?', $_SERVER[
'REQUEST_URI'], 2 );
68 $path = $_SERVER[
'SCRIPT_NAME'];
74 $period =
strrpos( $path,
'.' );
75 if ( $period !==
false ) {
91 wfDebug( __METHOD__ .
"() skipping compression (gzencode unavailable)\n" );
95 wfDebug( __METHOD__ .
"() skipping compression (headers already sent)\n" );
99 $ext = self::findUriExtension();
100 if (
$ext ==
'.gz' ||
$ext ==
'.tgz' ) {
109 wfDebug( __METHOD__ .
"() is compressing output\n" );
110 header(
'Content-Encoding: gzip' );
117 foreach ( $headers as
$header ) {
119 if ( $headerName ==
'vary:' ) {
125 header(
'Vary: Accept-Encoding' );
128 header(
'Key: Accept-Encoding;match=gzip' );
141 # Avoid weird excessive memory usage in PCRE on big articles
142 if (
preg_match(
'/<\s*cross-domain-policy(?=\s|>)/i',
$s ) ) {
143 return preg_replace(
'/<(\s*)(cross-domain-policy(?=\s|>))/i',
'<$1NOT-$2',
$s );
156 &&
isset( $_SERVER[
'SERVER_PROTOCOL'] )
157 && $_SERVER[
'SERVER_PROTOCOL'] ==
'HTTP/1.0'
159 header(
"Content-Length: $length" );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgDisableOutputCompression
Disable output compression (enabled by default if zlib is available)
$wgMangleFlashPolicy
When OutputHandler is used, mangle any output that contains <cross-domain-policy>.
$wgUseKeyHeader
Send the Key HTTP header for better caching.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfClientAcceptsGzip( $force=false)
Whether the client accept gzip encoding.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
if(!is_readable( $file)) $ext