Extension:MirrorTools

This is the MirrorTools extension.

What can this extension do?
This extension extends various API classes to allow revisions to be added with arbitrary user names (and, in a later version, timestamps). This aids in mirroring of another wiki's content.

Usage
See the api.php? on your wiki for more details.

Make sure you change that file, Extension:MirrorTools.

Also, add this table to your mirrorbot database (not your wiki database): Extension:MirrorTools/Queue table.

Development notes
Presently, this only handles mirroring of account creations. Partially written (and therefore not yet available) is mirroring of edits (mirroredit). Also needed are:
 * moves (mirrormove)
 * deletions (mirrordelete, to be handled by placing a deletion marker in the history)
 * undeletions (mirrorundelete, to be handled similarly to page creation)
 * protect (mirrorprotect)
 * unprotect (mirrorunprotect)
 * etc.

It may happen that a page is created on the remote wiki with a page title that already exists on the local wiki. That's fine; just merge the histories. It may happen that on the remote wiki, a page is moved to a page title that already exists on the local wiki. In such a case, the two page histories would be switched. E.g., suppose foo exists on the remote wiki (and is mirrored locally), and bar exists on the local wiki but not on the remote wiki. Then on the remote wiki, foo is moved to bar. On the local wiki, bar is then moved to foo, and foo is then moved to bar, and a redirect is put on top of the page history of foo redirecting the user to bar.

It may happen that some revisions will need to be buried in the page history below what already exists. This will require changing around the rev_parent_id values and such.

After all these are done, the next step will be to lock down mirrored pages to prevent any changes from being made to them, except by the mirrorbot.

Once that is done, the next step will be to cause clicks on "edit," "move," etc. tabs to take one to the appropriate urls at the remote wiki.

Next development steps
It needs to be programmed to have a loop that pulls and pushes at appropriate intervals. What that interval might be, I'm not sure. Maybe x seconds? Or, preferably, it can detect how far behind it's gotten and calibrate itself accordingly, based on the average account creations, edits, etc. per x seconds.

Installation
Add this to your LocalSettings.php file: