From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- includes/api/ApiFormatBase.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'includes/api/ApiFormatBase.php') 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 complete documentation, 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 complete documentation, or // This regex hacks around bug 13218 (" included in the URL) $text = preg_replace( "#(($protos).*?)(")?([ \\'\"<>\n]|<|>|")#", '\\1\\3\\4', $text ); // identify requests to api.php - $text = preg_replace( "#api\\.php\\?[^ \\()<\n\t]+#", '\\0', $text ); + $text = preg_replace( "#api\\.php\\?[^ <\n\t]+#", '\\0', $text ); if ( $this->mHelp ) { // make strings inside * bold $text = preg_replace( "#\\*[^<>\n]+\\*#", '\\0', $text ); @@ -288,8 +285,11 @@ See complete documentation, 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; -- cgit v1.2.2