Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5958513
SpecialRecordImpression.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
999 B
Referenced Files
None
Subscribers
None
SpecialRecordImpression.php
View Options
<?php
use
MediaWiki\SpecialPage\UnlistedSpecialPage
;
/**
* Null endpoint. This is a workaround to simplify analytics.
*/
class
SpecialRecordImpression
extends
UnlistedSpecialPage
{
// Cache this blank response for a day or so (60 * 60 * 24 s.)
public
const
CACHE_EXPIRY
=
86400
;
public
function
__construct
()
{
// Register special page
parent
::
__construct
(
"RecordImpression"
);
}
public
function
execute
(
$par
)
{
$this
->
getOutput
()->
disable
();
$this
->
sendHeaders
();
// Output nothing else.
}
/**
* Generate the HTTP response headers for the banner file
*/
private
function
sendHeaders
()
{
$expiry
=
static
::
CACHE_EXPIRY
;
header
(
"Content-Type: image/png"
);
// If we have a logged in user; do not cache (default for special pages)
// lest we capture a set-cookie header. Otherwise cache so we don't have
// too big of a DDoS hole.
if
(
!
$this
->
getUser
()->
isRegistered
()
)
{
header
(
"Cache-Control: public, s-maxage={$expiry}, max-age=0"
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 05:49 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
45/de/587c8e86f00a2324777af5ae565e
Default Alt Text
SpecialRecordImpression.php (999 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment