|
MediaWiki
master
|
Handles the backend logic of merging the histories of two pages. More...

Public Member Functions | |
| __construct (Title $source, Title $dest, $timestamp=false) | |
| MergeHistory constructor. More... | |
| checkPermissions (User $user, $reason) | |
| Check if the merge is possible. 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 sanity checks that the merge is valid. More... | |
| merge (User $user, $reason= '') | |
| Actually attempt the history move. More... | |
Public Attributes | |
| const | REVISION_LIMIT = 5000 |
| int Maximum number of revisions that can be merged at once (avoid too much slave lag) More... | |
Protected Attributes | |
| DatabaseBase | $dbw |
| Database that we are using. More... | |
| Title | $dest |
| Page to which history will be merged. More... | |
| MWTimestamp | $maxTimestamp |
| Maximum timestamp that we can use (oldest timestamp of dest) More... | |
| integer | $revisionsMerged |
| Number of revisions merged (for Special:MergeHistory success message) More... | |
| Title | $source |
| Page from which history will be merged. More... | |
| MWTimestamp bool | $timestampLimit |
| Timestamp upto which history from the source will be merged. More... | |
| string | $timeWhere |
| 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 34 of file MergeHistory.php.
MergeHistory constructor.
| Title | $source | Page from which history will be merged |
| Title | $dest | Page to which history will be merged |
| string | bool | $timestamp | Timestamp up to which history from the source will be merged |
Definition at line 66 of file MergeHistory.php.
References $dest, $maxTimestamp, $source, $timestamp, DB_MASTER, source, and wfGetDB().
| MergeHistory::checkPermissions | ( | User | $user, |
| $reason | |||
| ) |
Check if the merge is possible.
| User | $user | |
| string | $reason |
Definition at line 158 of file MergeHistory.php.
References $status, as, User\isAllowed(), EditPage\matchSummarySpamRegex(), source, and wfMergeErrorArrays().
Referenced by merge().
| MergeHistory::getMergedRevisionCount | ( | ) |
Get the number of revisions that were moved Used in the SpecialMergeHistory success message.
Definition at line 148 of file MergeHistory.php.
References $revisionsMerged.
| MergeHistory::getRevisionCount | ( | ) |
Get the number of revisions that will be moved.
Definition at line 133 of file MergeHistory.php.
References $count, $timeWhere, and source.
Referenced by isValidMerge().
| MergeHistory::isValidMerge | ( | ) |
Does various sanity checks that the merge is valid.
Only things based on the two pages should be checked here.
Definition at line 196 of file MergeHistory.php.
References $status, getRevisionCount(), Message\numParam(), and source.
Referenced by merge().
| MergeHistory::merge | ( | User | $user, |
$reason = '' |
|||
| ) |
Actually attempt the history move.
| User | $user | |
| string | $reason |
Definition at line 244 of file MergeHistory.php.
References $status, $timeWhere, checkPermissions(), WikiPage\factory(), Revision\insertOn(), isValidMerge(), Hooks\run(), source, TS_MW, and wfMessage().
|
protected |
Database that we are using.
Definition at line 46 of file MergeHistory.php.
|
protected |
Page to which history will be merged.
Definition at line 43 of file MergeHistory.php.
Referenced by __construct().
|
protected |
Maximum timestamp that we can use (oldest timestamp of dest)
Definition at line 49 of file MergeHistory.php.
Referenced by __construct().
|
protected |
Number of revisions merged (for Special:MergeHistory success message)
Definition at line 58 of file MergeHistory.php.
Referenced by getMergedRevisionCount().
|
protected |
Page from which history will be merged.
Definition at line 40 of file MergeHistory.php.
Referenced by __construct().
|
protected |
Timestamp upto which history from the source will be merged.
Definition at line 55 of file MergeHistory.php.
|
protected |
SQL WHERE condition that selects source revisions to insert into destination.
Definition at line 52 of file MergeHistory.php.
Referenced by getRevisionCount(), and merge().
| const MergeHistory::REVISION_LIMIT = 5000 |
int Maximum number of revisions that can be merged at once (avoid too much slave lag)
Definition at line 37 of file MergeHistory.php.
Referenced by MergeHistoryTest\testIsValidMergeRevisionLimit().