This hook seems to be very generic and very dangerous - it allows any extension to redefine template variables in a skin and as a result change the behaviour of a skin. We are running into various problems in the skin in MobileFrontend where language_urls in the context of our skin means a list of languages but that seems to differ from core.
I believe we should understand the existing uses of it and provide more generic hooks to guide usage.
e.g. in the case of languages a SkinAddLanguageUrl hook would be better as this would also change the return result of getLanguages.
Can someone make a case for the existing use cases of this hook and why the hook runs so close to the outputting of the HTML as I'm struggling to see why a generic hook like this would be better then a more specific one.
-------
<https://www.mediawiki.org/wiki/Category:SkinTemplateOutputPageBeforeExec_extensions>
Current users of `SkinTemplateOutputPageBeforeExec` hook per https://codesearch.wmflabs.org/ (as of 2018-01-30)
* BreadCrumbs2
* `$tpl->set( 'subtitle', .. )`
* `$template->data['sidebar'][ .. ] = .. `
* `$wgLogo = ..`
* CookieWarning
* ` $tpl->data['headelement'] .= ..`
* ExtraLanguageLink
* `$sk->getOutput()->getProperty( 'extralanguagelinks' )`
* `$tpl->get( 'language_urls' )`
* `$tpl->set( 'language_urls', .. )`
* StickToThatLanguage
* `$tpl->set( 'language_urls',.. )`
* TimezoneSelector
* `$tpl->set( 'lastmod', .. )`
* Wikibase
* `$template->set( 'language_urls', [] )`
* `$template->set( 'wbeditlanglinks`, .. )
* InterlanguageExtension
* `$template->data['language_urls'][] = ..`
* BlueSpiceFoundation, BlueSpiceReaders, BlueSpiceAuthors
* `$template->data['bs_..'][] = ..`
* HitCounters
* `$tpl->get( 'footerlinks' )`
* `$tpl->set( 'footerlinks', .. )`, `$tpl->set( 'viewcount', .. )`
* MobileFrontend
* `$tpl->data['footerlinks']`
* `$tpl->set( 'mobileview', .. )`
* `$tpl->set( 'footerlinks', .. )`
* `$tpl->set( 'desktop-toggle', .. )`, `$tpl->set( 'mobile-license', .. )`, `$tpl->set( 'privacy', .. )`,`$tpl->set( 'terms-use', .. )`
* SharedHelpPages
* `$tpl->set( 'copyright', .. )`
* UniversalLanguageSelector
* `$template->get( 'language_urls' )`, `$template->set( 'language_urls', .. )`
* WhoIsWatching
* `$tpl->set( 'numberofwatchingusers', .. )`
* Wikidata.org
* `$template->data['footerlinks'][] = ..`,`$template->set( .. )`
* WikidataPageBanner
* ` $tpl->set( 'prebodyhtml', .. )`, `$tpl->get( 'prebodyhtml' )`
* WikimediaMessages
* `$template->data['footerlinks'][] = ..`,`$template->set( .. )`