Page MenuHomePhabricator

Allow specifying what namespaces to generate sitemaps for, from the php command line
Open, LowestPublicFeature

Description

There is no way to specify what namespaces to generate sitemaps for
from the command line.

One ends up having e.g.,

$wgSitemapNamespaces=array(NS_MAIN,NS_TALK,NS_USER,NS_USER_TALK,NS_PROJECT,
NS_PROJECT_TALK,NS_TEMPLATE_TALK,NS_HELP,NS_HELP_TALK,NS_CATEGORY,NS_CATEGORY_TALK);

sitting around LocalSettings.php, read on every page view all day long,
even though one only generates sitemaps once a month. Or else one must append it each
time one wants to make a sitemap.

There isn't even a way to somehow on the command line
$ php [TELL PHP THOSE VALUES HERE] generateSitemap.php --server=http://.... --fspath=../


Version: 1.14.x
Severity: enhancement

Details

Reference
bz17748

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:31 PM
bzimport set Reference to bz17748.
bzimport added a subscriber: Unknown Object (MLST).

Could you elaborate on the underlying motivation / usecase here?
Would you like to create sitemaps for certain namespaces once a month, while more or less often for other namespaces? Does

sitting around LocalSettings.php, read on every page view all day long

imply some performance concerns?

(For the records: https://www.mediawiki.org/wiki/Manual:GenerateSitemap.php and T32344 implemented $wgSitemapNamespacesPriorities.)

All I know is I have a cron job that runs once a month to generate sitemaps,
and I have to put the specifications for in in LocalSettings.php, which is read a million times a month. What a waste!

s/in in/it in/

All items controlled by the script should be adjustable independently of LocalSettings.php .

Aklapper lowered the priority of this task from Low to Lowest.Dec 15 2016, 6:57 PM

I have to put the specifications for in in LocalSettings.php, which is read a million times a month. What a waste!

As I asked before: Is that a performance issue? What is the problem with the current situation?

LocalSettings might not be owned by the same people making the sitemaps.

You could just specify a different location of LocalSettings.php with --conf, there you can have your extra $wgSitemapNamespaces?

OK but then need a --conf LocalSettings.php --conf Extra.php for convenience.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM

Should be simple enough these days, by overwriting finalSetup() in the maintenance class. One can then use $this->getOption to ge the value of a command line option, and $settingsBuilder->getConfig() to get the configuration, and $settingsBuilder->overrideConfigValue() to set the new value.