dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Added assertArrayEquals method to MediaWikiTestCase to avoid duplicating asort...
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQuerySiteinfo.php
diff --git
a/includes/api/ApiQuerySiteinfo.php
b/includes/api/ApiQuerySiteinfo.php
index
e7102e0
..
511cbe4
100644
(file)
--- a/
includes/api/ApiQuerySiteinfo.php
+++ b/
includes/api/ApiQuerySiteinfo.php
@@
-93,6
+93,9
@@
class ApiQuerySiteinfo extends ApiQueryBase {
case 'showhooks':
$fit = $this->appendSubscribedHooks( $p );
break;
case 'showhooks':
$fit = $this->appendSubscribedHooks( $p );
break;
+ case 'variables':
+ $fit = $this->appendVariables( $p );
+ break;
default:
ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
}
default:
ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
}
@@
-121,9
+124,14
@@
class ApiQuerySiteinfo extends ApiQueryBase {
$data['dbtype'] = $GLOBALS['wgDBtype'];
$data['dbversion'] = $this->getDB()->getServerVersion();
$data['dbtype'] = $GLOBALS['wgDBtype'];
$data['dbversion'] = $this->getDB()->getServerVersion();
- $svn = SpecialVersion::getSvnRevision( $GLOBALS['IP'] );
- if ( $svn ) {
- $data['rev'] = $svn;
+ $git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] );
+ if ( $git ) {
+ $data['git-hash'] = $git;
+ } else {
+ $svn = SpecialVersion::getSvnRevision( $GLOBALS['IP'] );
+ if ( $svn ) {
+ $data['rev'] = $svn;
+ }
}
// 'case-insensitive' option is reserved for future
}
// 'case-insensitive' option is reserved for future
@@
-249,8
+257,9
@@
class ApiQuerySiteinfo extends ApiQueryBase {
protected function appendSpecialPageAliases( $property ) {
global $wgContLang;
$data = array();
protected function appendSpecialPageAliases( $property ) {
global $wgContLang;
$data = array();
- foreach ( $wgContLang->getSpecialPageAliases() as $specialpage => $aliases ) {
- $arr = array( 'realname' => $specialpage, 'aliases' => $aliases );
+ $aliases = $wgContLang->getSpecialPageAliases();
+ foreach ( SpecialPageFactory::getList() as $specialpage => $stuff ) {
+ $arr = array( 'realname' => $specialpage, 'aliases' => $aliases[$specialpage] );
$this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
$data[] = $arr;
}
$this->getResult()->setIndexedTagName( $arr['aliases'], 'alias' );
$data[] = $arr;
}
@@
-527,6
+536,12
@@
class ApiQuerySiteinfo extends ApiQueryBase {
return $this->getResult()->addValue( 'query', $property, $hooks );
}
return $this->getResult()->addValue( 'query', $property, $hooks );
}
+ public function appendVariables( $property ) {
+ $variables = MagicWord::getVariableIDs();
+ $this->getResult()->setIndexedTagName( $variables, 'v' );
+ return $this->getResult()->addValue( 'query', $property, $variables );
+ }
+
private function formatParserTags( $item ) {
return "<{$item}>";
}
private function formatParserTags( $item ) {
return "<{$item}>";
}
@@
-578,6
+593,7
@@
class ApiQuerySiteinfo extends ApiQueryBase {
'extensiontags',
'functionhooks',
'showhooks',
'extensiontags',
'functionhooks',
'showhooks',
+ 'variables',
)
),
'filteriw' => array(
)
),
'filteriw' => array(
@@
-613,7
+629,8
@@
class ApiQuerySiteinfo extends ApiQueryBase {
' skins - Returns a list of all enabled skins',
' extensiontags - Returns a list of parser extension tags',
' functionhooks - Returns a list of parser function hooks',
' skins - Returns a list of all enabled skins',
' extensiontags - Returns a list of parser extension tags',
' functionhooks - Returns a list of parser function hooks',
- ' showhooks - Returns a list of all subscribed hooks (contents of $wgHooks)'
+ ' showhooks - Returns a list of all subscribed hooks (contents of $wgHooks)',
+ ' variables - Returns a list of variable IDs',
),
'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
'showalldb' => 'List all database servers, not just the one lagging the most',
),
'filteriw' => 'Return only local or only nonlocal entries of the interwiki map',
'showalldb' => 'List all database servers, not just the one lagging the most',