Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4083324
RegistrationHooks.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
RegistrationHooks.php
View Options
<?php
/**
* DiscussionTools tag hooks
*
* @file
* @ingroup Extensions
* @license MIT
*/
namespace
MediaWiki\Extension\DiscussionTools\Hooks
;
use
MediaWiki\Config\ConfigException
;
class
RegistrationHooks
{
public
static
function
onRegistration
():
void
{
// Use globals instead of Config. Accessing it so early blows up unrelated extensions (T255704).
global
$wgLocaltimezone
,
$wgFragmentMode
;
// HACK: Do not run these tests on CI as the globals are not configured.
if
(
getenv
(
'ZUUL_PROJECT'
)
)
{
return
;
}
// If $wgLocaltimezone isn't hard-coded, it is evaluated from the system
// timezone. On some systems this isn't guaranteed to be static, for example
// on Debian, GMT can get converted to UTC, instead of Europe/London.
// Timestamp parsing assumes that the timezone never changes.
if
(
!
$wgLocaltimezone
)
{
throw
new
ConfigException
(
'DiscussionTools requires $wgLocaltimezone to be set'
);
}
// If $wgFragmentMode is set to use 'legacy' encoding, determining the IDs of our thread
// headings is harder, especially since the implementation is different in Parsoid.
if
(
!
isset
(
$wgFragmentMode
[
0
]
)
||
$wgFragmentMode
[
0
]
!==
'html5'
)
{
throw
new
ConfigException
(
'DiscussionTools requires $wgFragmentMode to be set to '
.
"[ 'html5', 'legacy' ] or [ 'html5' ]"
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 18 2026, 07:08 (7 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b1/6a/c11a62fd4581b69e3b8519c50135
Default Alt Text
RegistrationHooks.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment