Page MenuHomePhabricator

Allow Sites and Interwiki facilities to be configured consistently
Open, MediumPublic

Description

As per T113034: RFC: Overhaul Interwiki map, unify with Sites and WikiMap, we want to move towards a more flexible and powerful system for maintaining meta-information about other sites. In particular, the Interwiki and Sites facilities are to be united. To allow this, the configuration for these facilities also needs to be overhauled.

Currently, the following settings exist:

  • $wgSitesCacheFile: if set to a file, a FileBasedSiteLookup will be used that reads data from this file (see docs/sitescache.txt). Otherwise, a DBSiteStore is used that reads from the sites table.
  • $wgInterwikiCache: if set to a CDB file, ClassicInterwikiLookup reads from that file. If set to a PHP array, ClassicInterwikiLookup uses that array directly. If not set, it will read from the interwiki table.
  • Furthermore, ClassicInterwikiLookup uses the following options (see DefaultSettings.php for details): $wgLocalInterwiki and $wgLocalInterwikis, $wgInterwikiExpiry, $wgInterwikiScopes, and $wgInterwikiFallbackSite = 'wiki'.

In the future, the configuration should work like this:

  • $wgSiteInfoFiles: a list of PHP or JSON files to be read by a SiteStore as described in T135149: Implement a SiteLookup based on a nested array structure.. If empty, a DBSiteStore should be used for backwards compatibility. New installations should have this set to two files: sites.default.json with some default sites defined (like the default content of the interwiki table), and sites.local.json, which initially should be empty. These files would follow the structure outlined in P3044.
  • $wgSitesCacheFile: this should be just dropped. If a b/c period is needed, set $wgSiteInfoFiles = [ $wgSitesCacheFile ], and make sure that the SiteStore supports both the old structure (as described in docs/sitescache.txt) and the new structure described in P3044
  • $wgInterwikiCache: if set, this behaves as before, causing an ClassicInterwikiLookup to be used. Otherwise, $wgInterwikiLookup takes effect.
  • $wgInterwikiLookup: either "classic" or "sites". "classic" triggers the old behavior, using a ClassicInterwikiLookup to read from the interwiki table. "sites" causes a SiteLookupInterwikiLookup to be used, which is just an adapter to the SiteLookup service; see T135146: Create an adapter that implements InterwikiLookup on top of SiteLookup. New installations should have this set to "sites", existing installations will need this to remain set to "classic", so they can keep using the information fro the interwiki table.

The goal is to eventually have a SiteLookup that reads from files, and an InterwikiLookup that is based on that SiteLookup.

Event Timeline

Aklapper removed daniel as the assignee of this task.Jun 19 2020, 4:23 PM

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)