From: Niklas Laxström Date: Tue, 3 Jun 2008 20:24:00 +0000 (+0000) Subject: * Cache sidebar for all languages X-Git-Tag: 1.31.0-rc.0~47202 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=17fb1c007f26b0018df18da63249c0d634bd8b9e;p=lhc%2Fweb%2Fwiklou.git * Cache sidebar for all languages --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 108ce303af..6a390cb719 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -132,6 +132,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN from other pages in their group. * (bug 14263) Show a diff of the revert on rollback notification page. * (bug 13434) Show a warning when hash identical files exist +* Sidebar is now cached for all languages === Bug fixes in 1.13 === diff --git a/includes/Skin.php b/includes/Skin.php index e2e9a3235a..3f8c6b983f 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1650,24 +1650,18 @@ END; * Build an array that represents the sidebar(s), the navigation bar among them * * @return array - * @private */ function buildSidebar() { global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry; - global $wgLang, $wgContLang; - - $fname = 'SkinTemplate::buildSidebar'; - - wfProfileIn( $fname ); + global $wgLang; + wfProfileIn( __METHOD__ ); - $key = wfMemcKey( 'sidebar' ); - $cacheSidebar = $wgEnableSidebarCache && - ($wgLang->getCode() == $wgContLang->getCode()); + $key = wfMemcKey( 'sidebar', $wgLang->getCode() ); - if ($cacheSidebar) { + if ( $wgEnableSidebarCache ) { $cachedsidebar = $parserMemc->get( $key ); - if ($cachedsidebar!="") { - wfProfileOut($fname); + if ( $cachedsidebar ) { + wfProfileOut( __METHOD__ ); return $cachedsidebar; } } @@ -1683,7 +1677,7 @@ END; $heading = $line; } else { if (strpos($line, '|') !== false) { // sanity check - $line = explode( '|' , trim($line, '* '), 2 ); + $line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) ); $link = wfMsgForContent( $line[0] ); if ($link == '-') continue; @@ -1713,9 +1707,8 @@ END; } else { continue; } } } - if ($cacheSidebar) - $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry ); - wfProfileOut( $fname ); + if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry ); + wfProfileOut( __METHOD__ ); return $bar; } }