mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "Require $wgLocaltimezone to be set"
This commit is contained in:
commit
6ede82f74a
|
@ -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