Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5016
QueryTimezone.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:15 PM
2014-11-21 22:15:41 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
QueryTimezone.patch
View Options
Index: includes/api/ApiQuerySiteinfo.php
===================================================================
--- includes/api/ApiQuerySiteinfo.php (revision 37022)
+++ includes/api/ApiQuerySiteinfo.php (working copy)
@@ -77,7 +77,8 @@
}
protected function appendGeneralInfo($property) {
- global $wgSitename, $wgVersion, $wgCapitalLinks, $wgRightsCode, $wgRightsText, $wgLanguageCode, $IP, $wgEnableWriteAPI, $wgLang;
+ global $wgSitename, $wgVersion, $wgCapitalLinks, $wgRightsCode, $wgRightsText,
+ $wgLanguageCode, $IP, $wgEnableWriteAPI, $wgLang, $wgLocaltimezone, $wgLocalTZoffset, $wgContLang;
$data = array();
$mainPage = Title :: newFromText(wfMsgForContent('mainpage'));
@@ -96,6 +97,8 @@
$data['rightscode'] = $wgRightsCode;
$data['rights'] = $wgRightsText;
$data['lang'] = $wgLanguageCode;
+ if( $wgContLang->isRTL() )
+ $data['rtl'] = '';
$data['fallback8bitEncoding'] = $wgLang->fallback8bitEncoding();
if(wfReadOnly())
@@ -103,6 +106,17 @@
if($wgEnableWriteAPI)
$data['writeapi'] = '';
+ $tz = $wgLocaltimezone;
+ $offset = $wgLocalTZoffset;
+ if( is_null( $tz ) ) {
+ $tz = 'UTC';
+ $offset = 0;
+ } elseif( is_null( $offset ) ) {
+ $offset = 0;
+ }
+ $data['timezone'] = $tz;
+ $data['timeoffset'] = $offset;
+
$this->getResult()->addValue('query', $property, $data);
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4579
Default Alt Text
QueryTimezone.patch (1 KB)
Attached To
Mode
T16723: API: consider adding time zone and writing direction to meta=siteinfo
Attached
Detach File
Event Timeline
Log In to Comment