and multiple servers
* (bug 14572) Redirects listed on file links on image pages no longer redirect.
* (bug 14537) Change interwiki name for Old Church Slavonic (cu)
-* (bug 14583) Fix regression in recent changes "limit to certain categories."
-* (bug 14515) HTML nesting cleanup on edit form
-
=== API changes in 1.13 ===
* Replaced $wgAPIUCUserPrefixMinLength by the more generic $wgAPIMaxDBRows
* (bug 11719) Remove trailing blanks in YAML output.
* (bug 13541) Added siprop=specialpagealiases to meta=siteinfo
-* Added fallback8bitEncoding field to meta=siteinfo&siprop=general output
+* Added fallback8bitEncoding and readonly fields to meta=siteinfo&siprop=general output
* (bug 13544) Added prop=revid to action=parse
* (bug 13603) Added siprop=usergroups to meta=siteinfo
* Cleaned up redirect resolution
}
public function execute() {
-
$params = $this->extractRequestParams();
-
- foreach ($params['prop'] as $p) {
- switch ($p) {
- default :
- ApiBase :: dieDebug(__METHOD__, "Unknown prop=$p");
+ foreach($params['prop'] as $p)
+ {
+ switch ($p)
+ {
case 'general' :
$this->appendGeneralInfo($p);
break;
case 'usergroups' :
$this->appendUserGroups($p);
break;
+ default :
+ ApiBase :: dieDebug(__METHOD__, "Unknown prop=$p");
}
}
}
protected function appendGeneralInfo($property) {
global $wgSitename, $wgVersion, $wgCapitalLinks, $wgRightsCode, $wgRightsText, $wgLanguageCode, $IP, $wgEnableWriteAPI, $wgLang;
- $data = array ();
+ $data = array();
$mainPage = Title :: newFromText(wfMsgForContent('mainpage'));
$data['mainpage'] = $mainPage->getPrefixedText();
$data['base'] = $mainPage->getFullUrl();
$data['sitename'] = $wgSitename;
$data['generator'] = "MediaWiki $wgVersion";
- $svn = SpecialVersion::getSvnRevision ( $IP );
- if ( $svn ) $data['rev'] = $svn;
+ $svn = SpecialVersion::getSvnRevision($IP);
+ if($svn)
+ $data['rev'] = $svn;
$data['case'] = $wgCapitalLinks ? 'first-letter' : 'case-sensitive'; // 'case-insensitive' option is reserved for future
- if (isset($wgRightsCode))
+ if(isset($wgRightsCode))
$data['rightscode'] = $wgRightsCode;
$data['rights'] = $wgRightsText;
$data['lang'] = $wgLanguageCode;
$data['fallback8bitEncoding'] = $wgLang->fallback8bitEncoding();
-
- if ( $wgEnableWriteAPI )
+
+ if(wfReadOnly())
+ $data['readonly'] = '';
+ if($wgEnableWriteAPI)
$data['writeapi'] = '';
$this->getResult()->addValue('query', $property, $data);
protected function appendNamespaces($property) {
global $wgContLang;
-
- $data = array ();
- foreach ($wgContLang->getFormattedNamespaces() as $ns => $title) {
+ $data = array();
+ foreach($wgContLang->getFormattedNamespaces() as $ns => $title)
+ {
$data[$ns] = array (
'id' => $ns
);
ApiResult :: setContent($data[$ns], $title);
- if( MWNamespace::hasSubpages( $ns ) )
+ if(MWNamespace::hasSubpages($ns))
$data[$ns]['subpages'] = '';
}
protected function appendNamespaceAliases($property) {
global $wgNamespaceAliases;
-
- $data = array ();
- foreach ($wgNamespaceAliases as $title => $ns) {
+ $data = array();
+ foreach($wgNamespaceAliases as $title => $ns) {
$item = array (
'id' => $ns
);
$this->addTables('interwiki');
$this->addFields(array('iw_prefix', 'iw_local', 'iw_url'));
- if($filter === 'local') {
+ if($filter === 'local')
$this->addWhere('iw_local = 1');
- } elseif($filter === '!local') {
+ elseif($filter === '!local')
$this->addWhere('iw_local = 0');
- } elseif($filter !== false) {
+ elseif($filter !== false)
ApiBase :: dieDebug(__METHOD__, "Unknown filter=$filter");
- }
$this->addOption('ORDER BY', 'iw_prefix');
protected function appendDbReplLagInfo($property, $includeAll) {
global $wgShowHostnames;
-
$data = array();
-
if ($includeAll) {
if (!$wgShowHostnames)
$this->dieUsage('Cannot view all servers info unless $wgShowHostnames is true', 'includeAllDenied');
}
protected function appendStatistics($property) {
- $data = array ();
+ $data = array();
$data['pages'] = intval(SiteStats::pages());
$data['articles'] = intval(SiteStats::articles());
$data['views'] = intval(SiteStats::views());
protected function appendUserGroups($property) {
global $wgGroupPermissions;
-
$data = array ();
foreach ($wgGroupPermissions as $group => $permissions) {
$arr = array ('name' => $group, 'rights' => array_keys($permissions, true));
public function getAllowedParams() {
return array (
-
'prop' => array (
ApiBase :: PARAM_DFLT => 'general',
ApiBase :: PARAM_ISMULTI => true,