* @ingroup Skins
*/
abstract class Skin extends ContextSource {
+ /**
+ * @var string|null
+ */
protected $skinname = null;
+
protected $mRelevantTitle = null;
protected $mRelevantUser = null;
}
/**
- * @return string Skin name
+ * @since 1.31
+ * @param string|null $skinname
+ */
+ public function __construct( $skinname = null ) {
+ if ( is_string( $skinname ) ) {
+ $this->skinname = $skinname;
+ }
+ }
+
+ /**
+ * @return string|null Skin name
*/
public function getSkinName() {
return $this->skinname;
return $subpages;
}
- /**
- * @deprecated since 1.27, feature removed
- * @return bool Always false
- */
- function showIPinHeader() {
- wfDeprecated( __METHOD__, '1.27' );
- return false;
- }
-
/**
* @return string
*/
$s = '';
}
- if ( wfGetLB()->getLaggedReplicaMode() ) {
+ if ( MediaWikiServices::getInstance()->getDBLoadBalancer()->getLaggedReplicaMode() ) {
$s .= ' <strong>' . $this->msg( 'laggedslavemode' )->parse() . '</strong>';
}
function buildSidebar() {
global $wgEnableSidebarCache, $wgSidebarCacheExpiry;
- $callback = function () {
+ $callback = function ( $old = null, &$ttl = null ) {
$bar = [];
$this->addToSidebar( $bar, 'sidebar' );
Hooks::run( 'SkinBuildSidebar', [ $this, &$bar ] );
+ if ( MessageCache::singleton()->isDisabled() ) {
+ $ttl = WANObjectCache::TTL_UNCACHEABLE; // bug T133069
+ }
return $bar;
};
- if ( $wgEnableSidebarCache ) {
- $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
- $sidebar = $cache->getWithSetCallback(
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ $sidebar = $wgEnableSidebarCache
+ ? $cache->getWithSetCallback(
$cache->makeKey( 'sidebar', $this->getLanguage()->getCode() ),
- MessageCache::singleton()->isDisabled()
- ? $cache::TTL_UNCACHEABLE // bug T133069
- : $wgSidebarCacheExpiry,
+ $wgSidebarCacheExpiry,
$callback,
[ 'lockTSE' => 30 ]
- );
- } else {
- $sidebar = $callback();
- }
+ )
+ : $callback();
// Apply post-processing to the cached value
Hooks::run( 'SidebarBeforeOutput', [ $this, &$sidebar ] );