Quick hook to allow reusers of SiteConfiguration to customise siteFromDB, which is...
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 22 Aug 2008 12:08:21 +0000 (12:08 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 22 Aug 2008 12:08:21 +0000 (12:08 +0000)
docs/hooks.txt
includes/SiteConfiguration.php

index 31eb43b..927c827 100644 (file)
@@ -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,
index 9d09109..aa1c47f 100644 (file)
@@ -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 ) {