$codes = array_keys( Language::fetchLanguageNames() );
}
- global $wgMemc;
+ $cache = ObjectCache::getMainWANInstance();
foreach ( $codes as $code ) {
$sidebarKey = wfMemcKey( 'sidebar', $code );
- $wgMemc->delete( $sidebarKey );
+ $cache->delete( $sidebarKey, 5 );
}
// Update the message in the message blob store
* @return array
*/
function buildSidebar() {
- global $wgMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
+ global $wgEnableSidebarCache, $wgSidebarCacheExpiry;
+ $cache = ObjectCache::getMainWANInstance();
$key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() );
if ( $wgEnableSidebarCache ) {
- $cachedsidebar = $wgMemc->get( $key );
+ $cachedsidebar = $cache->get( $key );
if ( $cachedsidebar ) {
Hooks::run( 'SidebarBeforeOutput', array( $this, &$cachedsidebar ) );
Hooks::run( 'SkinBuildSidebar', array( $this, &$bar ) );
if ( $wgEnableSidebarCache ) {
- $wgMemc->set( $key, $bar, $wgSidebarCacheExpiry );
+ $cache->set( $key, $bar, $wgSidebarCacheExpiry );
}
Hooks::run( 'SidebarBeforeOutput', array( $this, &$bar ) );