Page MenuHomePhabricator

Remove $wgAllowSlowParserFunctions
Open, Needs TriagePublic

Description

$wgAllowSlowParserFunctions enables/disables the magic word {{PAGESINNAMESPACE}}. {{PAGESINNAMESPACE}} counts the number of pages in a particular namespace. See https://www.mediawiki.org/wiki/Manual:$wgAllowSlowParserFunctions. Counting pages for this magic word is currently resource-costly, so is usually disabled to prevent performance issues. This is now old Technical-Debt

By creating a new database table storing the count (since we don't have a large number of namespaces), or other mechanism (indexes etc.)

This would enable T385002: Special:NamespaceInfo should include counts of {{PAGESINNAMESPACE}} to be arranged in a straightforward way.

More generally, it would allow the magic word {{PAGESINNAMESPACE:foo}} to be re-coded and enabled generally.

Event Timeline

Scribunto currently provides a mw.site.stats.pagesInNamespace function with same functionality, and is enabled in Wikimedia projects.

The task description is a little incomplete, and title might be clearer.

Per https://www.mediawiki.org/wiki/Manual:$wgAllowSlowParserFunctions, the only magic word variable it does (seem to) affect is {{PAGESINNAMESPACE}}. So there are two parts to this; (1) creating the table and (2) rewriting the magic word function.