This previously only worked if $wgLocalVirtualHosts was set, which
was too specific to check and not used by WMF. Use the more generic
WikiMap class.
Two methods have been added there to do the work of enumerating
canonical wiki farm URLs and checking them against a given URL.
Bug: T172357
Change-Id: Id2415bab5d7f5a08b9f536858c32d329138384a2
If we don't have a valid canonical server and path to pass, there's no
point in returning a WikiReference that will fail in strange and unusal
ways.
This also documents that $wgServer/$wgCanonicalServer and $wgArticlePath
are required in SiteConfiguration.
Change-Id: Ib08011e9f1d0817a5d1bb165aba6b424785eaa6a
The mapping is not very good, but should be good enough, given
that only the URL parts are really being used.
Bug: T114107
Change-Id: I8186140aed5620cf7b4ba84aa4c9492c61f406d0
Given that the class is not constructed anywhere outside
of core the constructor can be altered without having to
worry about b/c.
Change-Id: Ie49c43a1724f05cb95a296dc0fad0f1c587d80ef