This already requires a DB domain ID, so there is no reason to have
hacks for trying to handle a wiki ID being passed in instead. If the
provided domain has a schema, it should not simply be ignored in the
comparison.
Change-Id: I9ced7a46fa05f32843a9a7d17391c5d0576b099c
Using domains means thats JobQueueDB has the right value to use for calls
like LoadBalancer::getConnection(). The full domain includes the schema in
the case of Postgres. This makes calls to getConnection() less awkward by
not relying on the fallback logic in reallyOpenConnection() for null schemas.
Make getWikiIdFromDomain/isCurrentWikiDomain account for the schema if it
is both defined and is not simply the generic "mediawiki" schema MediaWiki
uses by default. If all wikis use the default schema, the wiki IDs can get
by with DB/prefix alone, which various config and methods may be built around.
Otherwise, the config callbacks must account for schema and the config must
include it in various wiki domain ID lists to properly disambiguate wikis.
Also, clean up SiteConfiguration::siteFromDB() since it is not meant
to handle schemas unless the callback method was taylored to do so.
Finally, add more comments to DefaultSettings.php about already existing
limitations of wiki domain IDs and their components.
Change-Id: I8d94a650e5c99a19ee50551c5be9544318eb05b1
Use these in place of various wfWikiID() calls.
Also cleanup UserRightsProxy wiki ID variable names and removed unused
and poorly named getDBname() method.
Change-Id: Ib28889663989382d845511f8d34712b08317f60e
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