Page MenuHomePhabricator

Counter of number of functions for a WikiLambda installation
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):

We want to display the number of functions in a WikiLambda installation.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

On the main page of Wikifunctions we want to be able to display "Wikifunctions currently contains NNN functions" with an automatically updated number.

Benefits (why should this be implemented?):

Similar to the number of articles on Wikipedia, allows to quickly see how many functions there are.

Event Timeline

Should this be a magic word? Another thing to consider would be to show these stats on Special:Statistics, like Semantic MediaWiki does.

Should this be a magic word? Another thing to consider would be to show these stats on Special:Statistics, like Semantic MediaWiki does.

Seems the most logical to me in the same way article and other things are counted in. I’d say sure to Stats.

I am interested in taking this task. I need a few clarifications.

I have to implement a new Wikifunction that counts the total numer of functions on entire Wikifunctions.org website
OR
Recursively also calculate number of Sub-functions used by a Composition Function (eg, calculate)

On production at least (wikifunctions.org), nowadays we are able to get an accurate count from the labels DB table (declared in extensions/WikiLambda/sql/table-zobject_labels.json), and I can imagine various ways to trigger a query to that table, followed by updating the display. (But it's also true this approach would only count persistent functions with ZIDs; i.e., would not be able to look inside of compositions.)

Please see use case at:
https://www.wikifunctions.org/wiki/Template:Main_page

Comment in “the [[<tvar name="1">foundation:Special:MyLanguage/Policy:Terms_of_Use</tvar>|free]] library of <tvar name="fcount">1900+ <!-- no good way to count as of now--></tvar>”

I think it is the value for 1900+ that is required, and this is simply the count of persistent objects of type Z8. (I make it 2029, but who’s counting?)

Change #1139091 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Provide entries on Special:Statistics and matching 'magic word' variables

https://gerrit.wikimedia.org/r/1139091

Change #1139091 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Provide entries on Special:Statistics and matching 'magic word' variables

https://gerrit.wikimedia.org/r/1139091

Change #1143759 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Register our magic vars, so the parser knows to ask us what their values are

https://gerrit.wikimedia.org/r/1143759

Change #1143759 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Register our magic vars, so the parser knows to ask us what their values are

https://gerrit.wikimedia.org/r/1143759

Change #1145234 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@wmf/1.44.0-wmf.28] Register our magic vars, so the parser knows to ask us what their values are

https://gerrit.wikimedia.org/r/1145234

Change #1145235 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@wmf/1.45.0-wmf.1] Register our magic vars, so the parser knows to ask us what their values are

https://gerrit.wikimedia.org/r/1145235

Change #1145235 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@wmf/1.45.0-wmf.1] Register our magic vars, so the parser knows to ask us what their values are

https://gerrit.wikimedia.org/r/1145235

Change #1145234 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@wmf/1.44.0-wmf.28] Register our magic vars, so the parser knows to ask us what their values are

https://gerrit.wikimedia.org/r/1145234

Mentioned in SAL (#wikimedia-operations) [2025-05-13T21:00:56Z] <jforrester@deploy1003> Started scap sync-world: Backport for [[gerrit:1145235|Register our magic vars, so the parser knows to ask us what their values are (T345477)]], [[gerrit:1145234|Register our magic vars, so the parser knows to ask us what their values are (T345477)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-13T21:07:35Z] <jforrester@deploy1003> jforrester: Backport for [[gerrit:1145235|Register our magic vars, so the parser knows to ask us what their values are (T345477)]], [[gerrit:1145234|Register our magic vars, so the parser knows to ask us what their values are (T345477)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-05-13T21:14:09Z] <jforrester@deploy1003> Finished scap sync-world: Backport for [[gerrit:1145235|Register our magic vars, so the parser knows to ask us what their values are (T345477)]], [[gerrit:1145234|Register our magic vars, so the parser knows to ask us what their values are (T345477)]] (duration: 13m 13s)

Change #1260641 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/WikiLambda@master] Don't register magic words we don't plan to handle

https://gerrit.wikimedia.org/r/1260641

Change #1260641 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Don't register magic words we don't plan to handle

https://gerrit.wikimedia.org/r/1260641