From 8e22becd1bec0a46cc44ffbf37977f6e71801bd0 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 22 Aug 2008 12:08:21 +0000 Subject: [PATCH] Quick hook to allow reusers of SiteConfiguration to customise siteFromDB, which is pretty wikimedia-specific --- docs/hooks.txt | 5 +++++ includes/SiteConfiguration.php | 5 +++++ 2 files changed, 10 insertions(+) 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 ) { -- 2.20.1