Thanks a lot for your answers Brian and Bartosz! It indeed is a great feature if it was possible to configure multiple foreign file repos.
I have just tested on test2wiki and it seems that either the file uploaded first is preferred or an arbitrary file of the two is used. I guess I should document this.
@Bartosz Could you point me to the configuration of the two repos for test2wiki? I was not able to find anything related to this in "InitialiseSettings.php" etc. I suspect / speculate that it is done via the "ForeignDBViaLBRepo" class which would not help me. But one never knows. Trying to somehow create an array of arrays with the "ForeignAPIRepo" class does not work.
What I have locally realized on my personal testwiki with the following setting is I get all files from hewiki and commonswiki as well. This suprised me a bit though I have to note that description fetching only works for hewiki files.
$wgForeignFileRepos[] = [ 'class' => 'ForeignAPIRepo', 'name' => 'hewikipedia', 'apibase' => 'https://he.wikipedia.org/w/api.php', 'url' => 'https://upload.wikimedia.org/wikipedia/he', 'thumbUrl' => 'https://upload.wikimedia.org/wikipedia/he/thumb', 'hashLevels' => 2, 'transformVia404' => false, 'fetchDescription' => true, 'descriptionCacheExpiry' => 43200, 'apiThumbCacheExpiry' => 0, ];
Cheers Karsten
Am 14.03.2018 um 10:10 schrieb Bartosz Dziewoński:
We have this setup in Wikimedia production (kinda…): test2.wikipedia.org has both test.wikipedia.org and commons.wikimedia.org configured as foreign file repos. Conveniently it's a testing wiki, so you can try out how exactly this works.