Go to the documentation of this file.
37 $this->
dieUsage(
'The diff cannot be retrieved, ' .
38 'one revision does not exist or you do not have permission to view it.',
'baddiff' );
41 $contentHandler = $revision->getContentHandler();
42 $de = $contentHandler->createDifferenceEngine( $this->
getContext(),
50 if ( isset(
$params[
'fromtitle'] ) ) {
51 $vals[
'fromtitle'] =
$params[
'fromtitle'];
53 if ( isset(
$params[
'fromid'] ) ) {
54 $vals[
'fromid'] =
$params[
'fromid'];
56 $vals[
'fromrevid'] = $rev1;
57 if ( isset(
$params[
'totitle'] ) ) {
58 $vals[
'totitle'] =
$params[
'totitle'];
60 if ( isset(
$params[
'toid'] ) ) {
61 $vals[
'toid'] =
$params[
'toid'];
63 $vals[
'torevid'] = $rev2;
65 $difftext = $de->getDiffBody();
67 if ( $difftext ===
false ) {
69 'The diff cannot be retrieved. Maybe one or both revisions do ' .
70 'not exist or you do not have permission to view them.',
89 } elseif ( $titleText ) {
95 return $title->getLatestRevID();
96 } elseif ( $titleId ) {
102 return $title->getLatestRevID();
105 'A title, a page ID, or a revision number is needed for both the from and the to parameters',
131 'fromtitle' =>
'First title to compare',
132 'fromid' =>
'First page ID to compare',
133 'fromrev' =>
'First revision to compare',
134 'totitle' =>
'Second title to compare',
135 'toid' =>
'Second page ID to compare',
136 'torev' =>
'Second revision to compare',
143 'fromtitle' =>
array(
147 'fromrevid' =>
'integer',
152 'torevid' =>
'integer',
160 'Get the difference between 2 pages.',
161 'You must pass a revision number or a page title or a page ID id for each part (1 and 2).'
166 return array_merge( parent::getPossibleErrors(),
array(
167 array(
'code' =>
'inputneeded',
'info' =>
'A title or a revision is needed' ),
168 array(
'invalidtitle',
'title' ),
169 array(
'nosuchpageid',
'pageid' ),
172 'info' =>
'The diff cannot be retrieved. Maybe one or both ' .
173 'revisions do not exist or you do not have permission to view them.'
180 'api.php?action=compare&fromrev=1&torev=2' =>
'Create a diff between revision 1 and 2',
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
getContext()
Get the RequestContext object.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
static setContent(&$arr, $value, $subElemName=null)
Adds a content element to an array.
dieUsageMsg( $error)
Output the error message related to a certain array.
getResult()
Get the result object.
getPossibleErrors()
Returns a list of all possible errors returned by the module.
This abstract class implements many basic API functions, and is the base of all API classes.
getDescription()
Returns the description string for this module.
getParamDescription()
Returns an array of parameter descriptions.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
revisionOrTitleOrId( $revision, $titleText, $titleId)
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
presenting them properly to the user as errors is done by the caller $title
dieUsage( $description, $errorCode, $httpRespCode=0, $extradata=null)
Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an...
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
getModuleName()
Get the name of the module being executed by this instance.
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
getExamples()
Returns usage examples for this module.
static newFromID( $id, $flags=0)
Create a new Title from an article ID.