/**
* Get the name of the module as shown in the profiler log
+ *
+ * @param $db
+ *
* @return string
*/
public function getModuleProfileName( $db = false ) {
/**
* Callback for preg_replace_callback() call in makeHelpMsg().
* Replaces a source file name with a link to ViewVC
+ *
+ * @return string
*/
public function makeHelpMsg_callback( $matches ) {
global $wgAutoloadClasses, $wgAutoloadLocalClasses;
* @param $titleObj Title the page under consideration
* @param $userOption String The user option to consider when $watchlist=preferences.
* If not set will magically default to either watchdefault or watchcreations
- * @returns Boolean
+ * @return bool
*/
protected function getWatchlistValue ( $watchlist, $titleObj, $userOption = null ) {
/**
* Returns whether this module requires a Token to execute
- * @returns bool
+ * @return bool
*/
public function needsToken() {
return false;
/**
* Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token
- * @returns bool
+ * @return bool
*/
public function getTokenSalt() {
return false;
}
/**
- * Gets the user for whom to get the watchlist
- *
- * @returns User
- */
+ * Gets the user for whom to get the watchlist
+ *
+ * @param $params array
+ * @return User
+ */
public function getWatchlistUser( $params ) {
global $wgUser;
if ( !is_null( $params['owner'] ) && !is_null( $params['token'] ) ) {
/**
* Set how long the response should be cached.
+ *
+ * @param $maxage
*/
public function setCacheMaxAge( $maxage ) {
$this->setCacheControl( array(
/**
* Create an instance of an output formatter by its name
*
+ * @param $format string
+ *
* @return ApiFormatBase
*/
public function createPrinterByName( $format ) {
/**
* Print results using the current printer
+ *
+ * @param $isError bool
*/
protected function printResult( $isError ) {
$this->getResult()->cleanUpUTF8();
/**
* See ApiBase for description.
+ *
+ * @return array
*/
public function getAllowedParams() {
return array(
/**
* See ApiBase for description.
+ *
+ * @return array
*/
public function getParamDescription() {
return array(
/**
* See ApiBase for description.
+ *
+ * @return array
*/
public function getDescription() {
return array(
);
}
+ /**
+ * @return array
+ */
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
array( 'readonlytext' ),
/**
* Returns an array of strings with credits for the API
+ * @return array
*/
protected function getCredits() {
return array(
'or file a bug report at http://bugzilla.wikimedia.org/'
);
}
+
/**
* Sets whether the pretty-printer should format *bold* and $italics$
+ *
+ * @param $help bool
*/
public function setHelp( $help = true ) {
$this->mPrinter->setHelp( $help );
/**
* Override the parent to generate help messages for all available modules.
+ *
+ * @return string
*/
public function makeHelpMsg() {
global $wgMemc, $wgAPICacheHelpTimeout;
return $retval;
}
+ /**
+ * @return mixed|string
+ */
public function reallyMakeHelpMsg() {
$this->setHelp();
}
/**
- * @param $module ApiBase
- * @param $paramName String What type of request is this? e.g. action, query, list, prop, meta, format
+ * @param $module ApiBase
+ * @param $paramName String What type of request is this? e.g. action, query, list, prop, meta, format
* @return string
*/
public static function makeHelpMsgHeader( $module, $paramName ) {
return "* $paramName={$module->getModuleName()} $modulePrefix*";
}
- private $mIsBot = null;
- private $mIsSysop = null;
private $mCanApiHighLimits = null;
- /**
- * Returns true if the currently logged in user is a bot, false otherwise
- * OBSOLETE, use canApiHighLimits() instead
- */
- public function isBot() {
- if ( !isset( $this->mIsBot ) ) {
- global $wgUser;
- $this->mIsBot = $wgUser->isAllowed( 'bot' );
- }
- return $this->mIsBot;
- }
-
- /**
- * Similar to isBot(), this method returns true if the logged in user is
- * a sysop, and false if not.
- * OBSOLETE, use canApiHighLimits() instead
- */
- public function isSysop() {
- if ( !isset( $this->mIsSysop ) ) {
- global $wgUser;
- $this->mIsSysop = in_array( 'sysop', $wgUser->getGroups() );
- }
-
- return $this->mIsSysop;
- }
-
/**
* Check whether the current user is allowed to use high limits
* @return bool
/**
* Returns the version information of this file, plus it includes
* the versions for all files that are not callable proper API modules
+ *
+ * @return array
*/
public function getVersion() {
- $vers = array ();
+ $vers = array();
$vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
$vers[] = __CLASS__ . ': $Id$';
$vers[] = ApiBase::getBaseVersion();
* Add or overwrite an output format for this ApiMain. Intended for use by extending
* classes who wish to add to or modify current formatters.
*
- * @param $fmtName The identifier for this format.
- * @param $fmtClass The class implementing this format.
+ * @param $fmtName string The identifier for this format.
+ * @param $fmtClass ApiFormatBase The class implementing this format.
*/
protected function addFormat( $fmtName, $fmtClass ) {
$this->mFormats[$fmtName] = $fmtClass;