Developing extensions/Access to in-process data



This article gives a short introduction on how to gain access to in-process data when using an extension, through a registered hook, or an additional parser function.

In general, the SemanticData object when in an intermediary state (being processed in hooks or through the parser) is attached to MediaWiki's  to allow interdependent data exchange during the request.

To avoid loss of data or inconsistencies when accessing the SemanticData object, it is recommended to use a  instance as gateway.

// Create in-memory ParserOutput transfer object $parserData = ApplicationFactory::getInstance->newParserData(       $parser->getTitle,        $parser->getOutput    );

// Access the SemanticData object $parserData->getSemanticData;

// Do something

An individual extension is required to finalize its update process by invoking (otherwise the extended  instance will not be transferred to the    object):

// Ensures that objects are pushed to the ParserOutput $parserData->pushSemanticDataToParserOutput;

This ensures that the  contains the most up-to-date SemanticData object at the time when the   hook is called which then will trigger the   together with the accumulated data.