MediaWiki
master
|
Handles the backend logic of merging the histories of two pages. More...
Public Member Functions | |
__construct (PageIdentity $source, PageIdentity $dest, ?string $timestamp, ILoadBalancer $loadBalancer, IContentHandlerFactory $contentHandlerFactory, RevisionStore $revisionStore, WatchedItemStoreInterface $watchedItemStore, SpamChecker $spamChecker, HookContainer $hookContainer, WikiPageFactory $wikiPageFactory, TitleFormatter $titleFormatter, TitleFactory $titleFactory) | |
authorizeMerge (Authority $performer, string $reason=null) | |
Authorize the merge by $performer. More... | |
getMergedRevisionCount () | |
Get the number of revisions that were moved Used in the SpecialMergeHistory success message. More... | |
getRevisionCount () | |
Get the number of revisions that will be moved. More... | |
isValidMerge () | |
Does various checks that the merge is valid. More... | |
merge (Authority $performer, $reason='') | |
Actually attempt the history move. More... | |
probablyCanMerge (Authority $performer, string $reason=null) | |
Check whether $performer can execute the merge. More... | |
Public Attributes | |
const | REVISION_LIMIT = 5000 |
Maximum number of revisions that can be merged at once. More... | |
Protected Attributes | |
IDatabase | $dbw |
Database that we are using. More... | |
PageIdentity | $dest |
Page to which history will be merged. More... | |
MWTimestamp false | $maxTimestamp = false |
Maximum timestamp that we can use (oldest timestamp of dest). More... | |
int | $revisionsMerged |
Number of revisions merged (for Special:MergeHistory success message) More... | |
PageIdentity | $source |
Page from which history will be merged. More... | |
MWTimestamp false null | $timestampLimit = false |
Timestamp upto which history from the source will be merged. More... | |
string false null | $timeWhere = false |
SQL WHERE condition that selects source revisions to insert into destination. More... | |
Handles the backend logic of merging the histories of two pages.
Definition at line 57 of file MergeHistory.php.
MediaWiki\Page\MergeHistory::__construct | ( | PageIdentity | $source, |
PageIdentity | $dest, | ||
?string | $timestamp, | ||
ILoadBalancer | $loadBalancer, | ||
IContentHandlerFactory | $contentHandlerFactory, | ||
RevisionStore | $revisionStore, | ||
WatchedItemStoreInterface | $watchedItemStore, | ||
SpamChecker | $spamChecker, | ||
HookContainer | $hookContainer, | ||
WikiPageFactory | $wikiPageFactory, | ||
TitleFormatter | $titleFormatter, | ||
TitleFactory | $titleFactory | ||
) |
PageIdentity | $source | Page from which history will be merged |
PageIdentity | $dest | Page to which history will be merged |
?string | $timestamp Timestamp up to which history from the source will be merged | |
ILoadBalancer | $loadBalancer | |
IContentHandlerFactory | $contentHandlerFactory | |
RevisionStore | $revisionStore | |
WatchedItemStoreInterface | $watchedItemStore | |
SpamChecker | $spamChecker | |
HookContainer | $hookContainer | |
WikiPageFactory | $wikiPageFactory | |
TitleFormatter | $titleFormatter | |
TitleFactory | $titleFactory |
Definition at line 133 of file MergeHistory.php.
References MediaWiki\Page\MergeHistory\$dest, MediaWiki\Page\MergeHistory\$source, DB_PRIMARY, and Wikimedia\Rdbms\ILoadBalancer\getConnectionRef().
MediaWiki\Page\MergeHistory::authorizeMerge | ( | Authority | $performer, |
string | $reason = null |
||
) |
Authorize the merge by $performer.
Authority | $performer | |
string | null | $reason |
Definition at line 251 of file MergeHistory.php.
References MediaWiki\Permissions\Authority\authorizeWrite().
MediaWiki\Page\MergeHistory::getMergedRevisionCount | ( | ) |
Get the number of revisions that were moved Used in the SpecialMergeHistory success message.
Definition at line 185 of file MergeHistory.php.
References MediaWiki\Page\MergeHistory\$revisionsMerged.
MediaWiki\Page\MergeHistory::getRevisionCount | ( | ) |
Get the number of revisions that will be moved.
Definition at line 169 of file MergeHistory.php.
MediaWiki\Page\MergeHistory::isValidMerge | ( | ) |
Does various checks that the merge is valid.
Only things based on the two pages should be checked here.
Definition at line 268 of file MergeHistory.php.
References Message\numParam().
MediaWiki\Page\MergeHistory::merge | ( | Authority | $performer, |
$reason = '' |
|||
) |
Actually attempt the history move.
Authority | $performer | |
string | $reason |
Definition at line 316 of file MergeHistory.php.
References MediaWiki\Permissions\Authority\getUser(), and wfMessage().
MediaWiki\Page\MergeHistory::probablyCanMerge | ( | Authority | $performer, |
string | $reason = null |
||
) |
Check whether $performer can execute the merge.
Authority | $performer | |
string | null | $reason |
Definition at line 230 of file MergeHistory.php.
References MediaWiki\Permissions\Authority\probablyCan().
|
protected |
Database that we are using.
Definition at line 69 of file MergeHistory.php.
|
protected |
Page to which history will be merged.
Definition at line 66 of file MergeHistory.php.
Referenced by MediaWiki\Page\MergeHistory\__construct().
|
protected |
Maximum timestamp that we can use (oldest timestamp of dest).
Use ::getMaxTimestamp to lazily initialize.
Definition at line 78 of file MergeHistory.php.
|
protected |
Number of revisions merged (for Special:MergeHistory success message)
Definition at line 93 of file MergeHistory.php.
Referenced by MediaWiki\Page\MergeHistory\getMergedRevisionCount().
|
protected |
Page from which history will be merged.
Definition at line 63 of file MergeHistory.php.
Referenced by MediaWiki\Page\MergeHistory\__construct().
|
protected |
Timestamp upto which history from the source will be merged.
Use getTimestampLimit to lazily initialize.
Definition at line 90 of file MergeHistory.php.
|
protected |
SQL WHERE condition that selects source revisions to insert into destination.
Use ::getTimeWhere to lazy-initialize.
Definition at line 84 of file MergeHistory.php.
const MediaWiki\Page\MergeHistory::REVISION_LIMIT = 5000 |
Maximum number of revisions that can be merged at once.
Definition at line 60 of file MergeHistory.php.