API was using SVN's version keyword which GIT does not support.
All related methods were either removed, or for those that
could have been used from extensions, emptied out.
api.php?version now shows unrecognized param warning.
Change-Id: I910ca1448ed2ed697ac19b17c486d130aa1d7e03
* BREAKING CHANGE: '??_badcontinue' error code was changed to '??badcontinue'
for all query modules.
* ApiQueryBase adds 'badcontinue' error code if module has 'continue' parameter.
+* (bug 35885) Removed version parameter and all getVersion() methods.
=== Languages updated in 1.21 ===
* Typically includes the class name, the svn revision, timestamp, and
* last author. Usually done with SVN's Id keyword
* @return string
+ * @deprecated since 1.21, version string is no longer supported
*/
- public abstract function getVersion();
+ public function getVersion() {
+ wfDeprecated( __METHOD__, '1.21' );
+ return '';
+ }
/**
* Get the name of the module being executed by this instance
}
$msg .= $this->makeHelpArrayToString( $lnPrfx, "Help page", $this->getHelpUrls() );
-
- if ( $this->getMain()->getShowVersions() ) {
- $versions = $this->getVersion();
- $pattern = '/(\$.*) ([0-9a-z_]+\.php) (.*\$)/i';
- $callback = array( $this, 'makeHelpMsg_callback' );
-
- if ( is_array( $versions ) ) {
- foreach ( $versions as &$v ) {
- $v = preg_replace_callback( $pattern, $callback, $v );
- }
- $versions = implode( "\n ", $versions );
- } else {
- $versions = preg_replace_callback( $pattern, $callback, $versions );
- }
-
- $msg .= "Version:\n $versions\n";
- }
}
return $msg;
}
}
- /**
- * Callback for preg_replace_callback() call in makeHelpMsg().
- * Replaces a source file name with a link to ViewVC
- *
- * @param $matches array
- * @return string
- */
- public function makeHelpMsg_callback( $matches ) {
- global $wgAutoloadClasses, $wgAutoloadLocalClasses;
-
- $file = '';
- if ( isset( $wgAutoloadLocalClasses[get_class( $this )] ) ) {
- $file = $wgAutoloadLocalClasses[get_class( $this )];
- } elseif ( isset( $wgAutoloadClasses[get_class( $this )] ) ) {
- $file = $wgAutoloadClasses[get_class( $this )];
- }
-
- // Do some guesswork here
- $path = strstr( $file, 'includes/api/' );
- if ( $path === false ) {
- $path = strstr( $file, 'extensions/' );
- } else {
- $path = 'phase3/' . $path;
- }
-
- // Get the filename from $matches[2] instead of $file
- // If they're not the same file, they're assumed to be in the
- // same directory
- // This is necessary to make stuff like ApiMain::getVersion()
- // returning the version string for ApiBase work
- if ( $path ) {
- return "{$matches[0]}\n https://svn.wikimedia.org/" .
- "viewvc/mediawiki/trunk/" . dirname( $path ) .
- "/{$matches[2]}";
- }
- return $matches[0];
- }
-
/**
* Returns the description string for this module
* @return mixed string or array of strings
}
print "\n</pre>\n";
}
-
- /**
- * Returns a string that identifies the version of this class.
- * @return string
- */
- public static function getBaseVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Block';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=compare&fromrev=1&torev=2' => 'Create a diff between revision 1 and 2',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Account creation';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Delete';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getExamples() {
return array();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Edit';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:E-mail';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Parsing_wikitext#expandtemplates';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=feedcontributions&user=Reedy',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Watchlist_feed';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
=> 'Revert Wiki.png to the version of 20110305152740',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return $this->getIsHtml() ? ' (pretty-print in HTML)' : '';
}
-
- public static function getBaseVersion() {
- return __CLASS__ . ': $Id$';
- }
}
/**
ApiBase::dieDebug( __METHOD__, 'Invalid feed class/item' );
}
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in PHP\'s var_export() format' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in PHP\'s var_dump() format' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
return 'Output data in JSON format' . parent::getDescription();
}
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output nothing' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in serialized PHP format' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
}
$this->printText( $data['text'] );
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in PHP\'s print_r() format' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in WDDX format' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in XML format' . parent::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getDescription() {
return 'Output data in YAML format' . ApiFormatBase::getDescription();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'https://www.mediawiki.org/wiki/API:Quick_start_guide',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Import';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
/**
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Login';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Logout';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
private $mPrinter;
private $mModules, $mModuleNames, $mFormats, $mFormatNames;
- private $mResult, $mAction, $mShowVersions, $mEnableWrite;
+ private $mResult, $mAction, $mEnableWrite;
private $mInternalMode, $mSquidMaxage, $mModule;
private $mCacheMode = 'private';
$this->mFormatNames = array_keys( $this->mFormats );
$this->mResult = new ApiResult( $this );
- $this->mShowVersions = false;
$this->mEnableWrite = $enableWrite;
$this->mSquidMaxage = - 1; // flag for executeActionWithErrorHandling()
$params = $this->extractRequestParams();
- $this->mShowVersions = $params['version'];
$this->mAction = $params['action'];
if ( !is_string( $this->mAction ) ) {
ApiBase::PARAM_DFLT => 'help',
ApiBase::PARAM_TYPE => $this->mModuleNames
),
- 'version' => false,
'maxlag' => array(
ApiBase::PARAM_TYPE => 'integer'
),
return array(
'format' => 'The format of the output',
'action' => 'What action you would like to perform. See below for module help',
- 'version' => 'When showing help, include version for each module',
'maxlag' => array(
'Maximum lag can be used when MediaWiki is installed on a database replicated cluster.',
'To save actions causing any more site replication lag, this parameter can make the client',
$this->setHelp();
// Get help text from cache if present
$key = wfMemcKey( 'apihelp', $this->getModuleName(),
- SpecialVersion::getVersion( 'nodb' ) .
- $this->getShowVersions() );
+ SpecialVersion::getVersion( 'nodb' ) );
if ( $wgAPICacheHelpTimeout > 0 ) {
$cached = $wgMemc->get( $key );
if ( $cached ) {
/**
* Check whether the user wants us to show version information in the API help
* @return bool
+ * @deprecated since 1.21, always returns false
*/
public function getShowVersions() {
- return $this->mShowVersions;
- }
-
- /**
- * 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[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";
- $vers[] = __CLASS__ . ': $Id$';
- $vers[] = ApiBase::getBaseVersion();
- $vers[] = ApiFormatBase::getBaseVersion();
- $vers[] = ApiQueryBase::getBaseVersion();
- return $vers;
+ wfDeprecated( __METHOD__, '1.21' );
+ return false;
}
/**
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Move';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Opensearch';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=options&reset=&change=skin=monobook&optionname=nickname&optionvalue=[[User:Beau|Beau]]%20([[User_talk:Beau|talk]])&token=123ABC',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
array( 'code' => 'multisource', 'info' => "Cannot use 'revids' at the same time as 'dataSource'" ),
) );
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
$result = $this->getResult();
$retval['classname'] = get_class( $obj );
$retval['description'] = implode( "\n", (array)$obj->getFinalDescription() );
-
$retval['examples'] = '';
- $retval['version'] = implode( "\n", (array)$obj->getVersion() );
+ // version is deprecated since 1.21, but needs to be returned for v1
+ $retval['version'] = '';
$retval['prefix'] = $obj->getModulePrefix();
if ( $obj->isReadMode() ) {
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Parameter_information';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Parsing_wikitext#parse';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Patrol';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Protect';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Purge';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'https://www.mediawiki.org/wiki/API:Lists',
);
}
-
- public function getVersion() {
- $psModule = new ApiPageSet( $this );
- $vers = array();
- $vers[] = __CLASS__ . ': $Id$';
- $vers[] = $psModule->getVersion();
- return $vers;
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Allcategories';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Allimages';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return "https://www.mediawiki.org/wiki/API:All{$this->descriptionLink}s";
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Meta#allmessages_.2F_am';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Allpages';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Allusers';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return $this->helpUrl;
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
}
return $errors;
}
-
- /**
- * Get version string for use in the API help output
- * @return string
- */
- public static function getBaseVersion() {
- return __CLASS__ . ': $Id$';
- }
}
/**
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Blocks';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#categories_.2F_cl';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#categoryinfo_.2F_ci';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Categorymembers';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Deletedrevs';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getExamples() {
return array();
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#duplicatefiles_.2F_df';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Exturlusage';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#extlinks_.2F_el';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
),
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=query&generator=iwbacklinks&giwbltitle=Test&giwblprefix=wikibooks&prop=info'
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=query&prop=iwlinks&titles=Main%20Page' => 'Get interwiki links from the [[Main Page]]',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#imageinfo_.2F_ii';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#images_.2F_im';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#info_.2F_in';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=query&generator=langbacklinks&glbltitle=Test&glbllang=fr&prop=info'
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#langlinks_.2F_ll';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return $this->helpUrl;
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Logevents';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#pageprops_.2F_pp';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Protectedtitles';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=query&list=querypage&qppage=Ancientpages'
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getExamples() {
return 'api.php?action=query&list=random&rnnamespace=0&rnlimit=2';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryRandom.php overlordq$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Recentchanges';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Properties#revisions_.2F_rv';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Search';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Meta#siteinfo_.2F_si';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
);
}
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
-
}
'api.php?action=query&list=tags&tgprop=displayname|description|hitcount'
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Usercontribs';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Meta#userinfo_.2F_ui';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Users';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Watchlist';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=query&generator=watchlistraw&gwrshow=changed&prop=revisions',
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function execute() {
ApiBase::dieDebug( __METHOD__, 'execute() is not supported on Result object' );
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Rollback';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
}
return $outputData;
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
class ApiFormatXmlRsd extends ApiFormatXml {
public function getMimeType() {
return 'application/rsd+xml';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:SetNotificationTimestamp';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
'api.php?action=tokens&type=email|move' => 'Retrieve an email token and a move token'
);
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Block';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Undelete';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Upload';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:User_group_membership';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Watch';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}