Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6122465
SpecialRecordImpression.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1019 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"
);
}
/** @inheritDoc */
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
Oct 7 2026, 06:42 (6 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9b/90/a16a93aa9e7ffe449b9896904133
Default Alt Text
SpecialRecordImpression.php (1019 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment