From: Andrew Garrett Date: Fri, 22 Aug 2008 12:08:21 +0000 (+0000) Subject: Quick hook to allow reusers of SiteConfiguration to customise siteFromDB, which is... X-Git-Tag: 1.31.0-rc.0~45722 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=8e22becd1bec0a46cc44ffbf37977f6e71801bd0;p=lhc%2Fweb%2Fwiklou.git Quick hook to allow reusers of SiteConfiguration to customise siteFromDB, which is pretty wikimedia-specific --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 31eb43b66c..927c827195 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1064,6 +1064,11 @@ $text: Text being shown $title: Title of the custom script/stylesheet page $output: Current OutputPage object +'SiteFromDB': Customise the conversion of a database name to site information in SiteConfiguration +$db: The DB name being converted. +&$site: The site type (out). +&$lang: The "language" (subdomain) + 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed &$siteNotice: HTML returned as the sitenotice Return true to allow the normal method of notice selection/rendering to work, diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 9d091097f1..aa1c47f7ba 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -218,6 +218,11 @@ class SiteConfiguration { * @param $db */ function siteFromDB( $db ) { + $site = $lang = ''; + + if (!wfRunHooks( 'SiteFromDB', array( $db, &$site, &$lang ) ) ) + return array( $site, $lang ); + $site = NULL; $lang = NULL; foreach ( $this->suffixes as $suffix ) {