Splitting from T286515#7235469.
At https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/477ea0f97c1d763582b76570882e530149dd8356/wmf-config/CommonSettings.php#2845 there's a hack that does:
// Set up $wgMathFullRestbaseURL - similar to VE RESTBase config above // HACK: $wgServerName is not available yet at this point, it's set by Setup.php // so use a hook $wgExtensionFunctions[] = function () { global $wgServerName, $wgMathFullRestbaseURL, $wmfRealm; $wgMathFullRestbaseURL = $wmfRealm === 'production' ? 'https://wikimedia.org/api/rest_' // T136205 : "//$wgServerName/api/rest_"; };
AFAICT no other service needs this hack, why is Math special? Can it do it like everything else and not require the extension function?