Page MenuHomePhabricator

Magic word to count the number of pages in a given namespace
Closed, ResolvedPublic

Description

Author: wiki.warx

Description:
There is only one special variable for counting pages in MW - it is
{{NUMBEROFARTICLES}}.

I've met two situations where this was not enought - there were new namespaces
created, and no easy way to count number of pages in this new namespaces in way
that {{NUMBEROFARTICLES}} provides.

So I suppose adding new kind of variable caled eg. {{NUMBEROFPAGESINNAMESPACE}}
or simple {{NUMBEROFPAGES}} with paramter counting number of namespace that
should be checked.

For example:

  • {{NUMBEROFPAGES:0}} - same as {{NUMBEROFARTICLES}}
  • {{NUMBEROFPAGES:1}} - number of discussions of articles

etc.


Version: unspecified
Severity: enhancement

Details

Reference
bz5932

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:14 PM
bzimport set Reference to bz5932.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

{{NUMBEROFPAGES}} is now a count of all pages in the wiki. I would recommend
calling a variable such as this requests {{PAGESINNAMESPACE}} or similar.

As an alternative, we could add a configuration variable which would allow us to
add more namespaces to the check in Article::isCountable (which dictates what is
classed as an "article" for the purposes of the statistics).

robchur wrote:

(In reply to comment #1)

As an alternative, we could add a configuration variable which would allow us to
add more namespaces to the check in Article::isCountable (which dictates what is
classed as an "article" for the purposes of the statistics).

This was added in SVN trunk, r14738.

robchur wrote:

{{PAGESINNAMESPACE}} added in SVN trunk, r14741 with {{PAGESINNS}} alias.

Is this safe? Mass operations that hit millions of index rows
sound like they might not be the funnest. Recommend removing
this and running it past domas.