MediaWiki master
|
This class performs some operations related to tracking categories, such as adding a tracking category to a ParserOutput, and creating a list of all such categories. More...
Public Member Functions | |
__construct (ServiceOptions $options, NamespaceInfo $namespaceInfo, TitleParser $titleParser, LoggerInterface $logger) | |
addTrackingCategory (ParserOutput $parserOutput, string $msg, ?PageReference $contextPage) | |
Add a tracking category to a ParserOutput, getting the title from a system message. | |
getTrackingCategories () | |
Read the global and extract title objects from the corresponding messages. | |
resolveTrackingCategory (string $msg, ?PageReference $contextPage) | |
Resolve a tracking category. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
This class performs some operations related to tracking categories, such as adding a tracking category to a ParserOutput, and creating a list of all such categories.
Definition at line 42 of file TrackingCategories.php.
MediaWiki\Category\TrackingCategories::__construct | ( | ServiceOptions | $options, |
NamespaceInfo | $namespaceInfo, | ||
TitleParser | $titleParser, | ||
LoggerInterface | $logger ) |
ServiceOptions | $options | |
NamespaceInfo | $namespaceInfo | |
TitleParser | $titleParser | |
LoggerInterface | $logger |
Definition at line 100 of file TrackingCategories.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), and ExtensionRegistry\getInstance().
MediaWiki\Category\TrackingCategories::addTrackingCategory | ( | ParserOutput | $parserOutput, |
string | $msg, | ||
?PageReference | $contextPage ) |
Add a tracking category to a ParserOutput, getting the title from a system message.
Any message used with this function should be registered so it will show up on [[Special:TrackingCategories]]. Core messages should be added to TrackingCategories::CORE_TRACKING_CATEGORIES, and extensions should add to "TrackingCategories" in their extension.json.
ParserOutput | $parserOutput | The target ParserOutput which will store the new category |
string | $msg | Message key |
?PageReference | $contextPage | Context page title |
Definition at line 257 of file TrackingCategories.php.
MediaWiki\Category\TrackingCategories::getTrackingCategories | ( | ) |
Read the global and extract title objects from the corresponding messages.
TODO consider renaming this method, since this class is retrieved from MediaWikiServices, resulting in calls like: MediaWikiServices::getInstance()->getTrackingCategories()->getTrackingCategories()
Definition at line 126 of file TrackingCategories.php.
References MediaWiki\MainConfigNames\EnableMagicLinks, NS_CATEGORY, NS_MEDIAWIKI, MediaWiki\MainConfigNames\TrackingCategories, and wfMessage().
MediaWiki\Category\TrackingCategories::resolveTrackingCategory | ( | string | $msg, |
?PageReference | $contextPage ) |
Resolve a tracking category.
string | $msg | Message key |
?PageReference | $contextPage | Context page title |
Definition at line 209 of file TrackingCategories.php.
const MediaWiki\Category\TrackingCategories::CONSTRUCTOR_OPTIONS |
Definition at line 47 of file TrackingCategories.php.