mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-12 01:16:19 +00:00
Require $wgLocaltimezone to be set
Change-Id: I0e09d87152bf7694c8ada935d5c37c244d70cb69
This commit is contained in:
parent
c60c154b38
commit
7745d4a610
|
@ -14,6 +14,7 @@
|
|||
"MessagesDirs": {
|
||||
"DiscussionTools": [ "i18n" ]
|
||||
},
|
||||
"callback": "DiscussionToolsHooks::onRegistration",
|
||||
"ResourceFileModulePaths": {
|
||||
"localBasePath": "modules",
|
||||
"remoteExtPath": "DiscussionTools/modules"
|
||||
|
|
|
@ -8,6 +8,21 @@
|
|||
*/
|
||||
|
||||
class DiscussionToolsHooks {
|
||||
|
||||
public static function onRegistration() {
|
||||
global $wgLocaltimezone;
|
||||
// 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.
|
||||
//
|
||||
// HACK: Do not run this test on CI as $wgLocaltimezone is not configured.
|
||||
if ( !$wgLocaltimezone && !getenv( 'ZUUL_PROJECT' ) ) {
|
||||
throw new \ConfigException( 'DiscussionTools requires $wgLocaltimezone to be set' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds DiscussionTools JS to the output.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue