Remove getSecondaryDataUpdates and friends from ParserOutput.
authordaniel <daniel.kinzler@wikimedia.de>
Sun, 15 Feb 2015 19:34:43 +0000 (20:34 +0100)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 24 Feb 2015 10:01:16 +0000 (11:01 +0100)
commit95c85f71b178e75efd0a4444a4f39bbce27e694f
treeb02d097cef77385f58b1a7b435453e1652f424ae
parenta8c16f64778c09149c6668ab72f6d0b2588517e0
Remove getSecondaryDataUpdates and friends from ParserOutput.

This is a hard deprecation, with getSecondaryDataUpdates returning an
empty array and addSecondaryDataUpdate throwing an exception. This seems
prudent since there are no known users of these methods, and they
interfere with the parser cache:

DataUpdates are basically jobs, they need access to services to
function. That makes them inherently non-serializable. This interferes
with the function of the parser cache, which serializes ParserOutput
objects in order to persist them.

This could be solved by splitting DataUpdates into DataUpdateDefinitions
and DataUpdateHandlers, similar to how JobSpecification works with
wgJobClasses. That however seems pointless and overkill, since
ParserOutput already has a mechanism for storing arbitrary data,
including any info needed by an UpdateJob: the setExtensionData method.

After this change, the preferred method to introduce custom data updates
is to store any relevant data using setExtensionData and
implement Content::getSecondaryDataUpdates() if possible. If not,
use the 'SecondaryDataUpdates' hook to construct the necessary update
objects from the info stored using setExtensionData.

Change-Id: I0f6f49e61fa3d8904e55f42c99f342a3dc357495
RELEASE-NOTES-1.25
docs/hooks.txt
includes/api/ApiStashEdit.php
includes/content/AbstractContent.php
includes/content/Content.php
includes/parser/ParserOutput.php
tests/phpunit/includes/parser/ParserOutputTest.php