diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
commit | d9022f63880ce039446fba8364f68e656b7bf4cb (patch) | |
tree | 16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/api/ApiFormatBase.php | |
parent | 27cf83d177256813e2e802241085fce5dd0f3fb9 (diff) |
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiFormatBase.php')
-rw-r--r-- | includes/api/ApiFormatBase.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 8c8235b8..543c90ce 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -24,11 +24,6 @@ * @file */ -if ( !defined( 'MEDIAWIKI' ) ) { - // Eclipse helper - will be ignored in production - require_once( 'ApiBase.php' ); -} - /** * This is the abstract base class for API formatters. * @@ -235,8 +230,10 @@ See <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>, or public function getBuffer() { return $this->mBuffer; } + /** * Set the flag to buffer the result instead of printing it. + * @param $value bool */ public function setBufferResult( $value ) { $this->mBufferResult = $value; @@ -267,7 +264,7 @@ See <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>, or // This regex hacks around bug 13218 (" included in the URL) $text = preg_replace( "#(($protos).*?)(")?([ \\'\"<>\n]|<|>|")#", '<a href="\\1">\\1</a>\\3\\4', $text ); // identify requests to api.php - $text = preg_replace( "#api\\.php\\?[^ \\()<\n\t]+#", '<a href="\\0">\\0</a>', $text ); + $text = preg_replace( "#api\\.php\\?[^ <\n\t]+#", '<a href="\\0">\\0</a>', $text ); if ( $this->mHelp ) { // make strings inside * bold $text = preg_replace( "#\\*[^<>\n]+\\*#", '<b>\\0</b>', $text ); @@ -288,8 +285,11 @@ See <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>, or return $text; } - protected function getExamples() { - return 'api.php?action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName(); + public function getExamples() { + return array( + 'api.php?action=query&meta=siteinfo&siprop=namespaces&format=' . $this->getModuleName() + => "Format the query result in the {$this->getModuleName()} format", + ); } public function getHelpUrls() { @@ -335,6 +335,8 @@ class ApiFormatFeedWrapper extends ApiFormatBase { /** * Feed does its own headers + * + * @return null */ public function getMimeType() { return null; @@ -342,6 +344,8 @@ class ApiFormatFeedWrapper extends ApiFormatBase { /** * Optimization - no need to sanitize data that will not be needed + * + * @return bool */ public function getNeedsRawData() { return true; |