Generalizing LinksUpdate to allow extensions to add arbitrary update handlers.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 8 May 2012 15:09:30 +0000 (17:09 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Sun, 13 May 2012 18:53:37 +0000 (20:53 +0200)
commita12ce17c6e7c7a4d16c57f848d98292f949cc4df
tree0bd08662857905b9d6463813d65635c0e0f79a55
parentf8e03276562b537b1efabcdf956c573667dccb94
Generalizing LinksUpdate to allow extensions to add arbitrary update handlers.

This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.

This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.

This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.

Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.

Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.

Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
             but might break extensions when changed. Marking as todo for now.

Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).

Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f
includes/AutoLoader.php
includes/DataUpdate.php [new file with mode: 0644]
includes/LinksUpdate.php
includes/SqlDataUpdate.php [new file with mode: 0644]
includes/WikiPage.php
includes/api/ApiPurge.php
includes/job/RefreshLinksJob.php
includes/parser/ParserOutput.php