Go to the documentation of this file.
40 parent::__construct(
'ComparePages' );
52 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
58 'label-message' =>
'compare-page1',
61 'validation-callback' => [ $this,
'checkExistingTitle' ],
67 'label-message' =>
'compare-rev1',
70 'validation-callback' => [ $this,
'checkExistingRevision' ],
75 'label-message' =>
'compare-page2',
78 'validation-callback' => [ $this,
'checkExistingTitle' ],
84 'label-message' =>
'compare-rev2',
87 'validation-callback' => [ $this,
'checkExistingRevision' ],
102 $form->setSubmitTextMsg(
'compare-submit' );
103 $form->suppressReset();
104 $form->setMethod(
'get' );
105 $form->setSubmitCallback( [ __CLASS__,
'showDiff' ] );
108 $form->displayForm(
'' );
116 if ( $rev1 && $rev2 ) {
120 $contentHandler = $revision->getContentHandler();
121 $de = $contentHandler->createDifferenceEngine( $form->
getContext(),
125 ( $data[
'Action'] ==
'purge' ),
126 ( $data[
'Unhide'] ==
'1' )
128 $de->showDiffPage(
true );
139 return $title->getLatestRevID();
152 return $this->
msg(
'compare-invalid-title' )->parseAsBlock();
154 if ( !
$title->exists() ) {
155 return $this->
msg(
'compare-title-not-exists' )->parseAsBlock();
166 if ( $revision ===
null ) {
167 return $this->
msg(
'compare-revision-not-exists' )->parseAsBlock();
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
getContext()
Get the base IContextSource object.
msg( $key)
Wrapper around wfMessage that sets the current context.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
getOutput()
Get the OutputPage being used for this instance.
checkExistingRevision( $value, $alldata)
checkExistingTitle( $value, $alldata)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
namespace and then decline to actually register it file or subcat img or subcat $title
Implements Special:ComparePages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
static showDiff( $data, HTMLForm $form)
getContext()
Gets the context this SpecialPage is executed in.
Parent class for all special pages.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Represents a title within MediaWiki.
execute( $par)
Show a form for filtering namespace and username.
static revOrTitle( $revision, $title)
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...