*/
static function makeVariablesScript( $data ) {
if ( $data ) {
- return Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript( ResourceLoader::makeConfigSetScript( $data ) )
+ return ResourceLoader::makeInlineScript(
+ ResourceLoader::makeConfigSetScript( $data )
);
} else {
return '';
* @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 ) );
* Get a cached notice
*
* @param string $name Message name, or 'default' for $wgSiteNotice
- * @return string HTML fragment
+ * @return string|bool HTML fragment, or false to indicate that the caller
+ * should fall back to the next notice in its sequence
*/
private function getCachedNotice( $name ) {
global $wgRenderHashAppend, $parserMemc, $wgContLang;
}
} else {
$msg = $this->msg( $name )->inContentLanguage();
- if ( $msg->isDisabled() ) {
+ if ( $msg->isBlank() ) {
+ return '';
+ } elseif ( $msg->isDisabled() ) {
return false;
}
$notice = $msg->plain();
$siteNotice = $this->getCachedNotice( 'sitenotice' );
} else {
$anonNotice = $this->getCachedNotice( 'anonnotice' );
- if ( !$anonNotice ) {
+ if ( $anonNotice === false ) {
$siteNotice = $this->getCachedNotice( 'sitenotice' );
} else {
$siteNotice = $anonNotice;
}
}
- if ( !$siteNotice ) {
+ if ( $siteNotice === false ) {
$siteNotice = $this->getCachedNotice( 'default' );
}
}