<?php
if ( ! defined( 'MEDIAWIKI' ) )
- die();
+ die( -1 );
/**
*
# while code from www.php.net
while (false !== ($file = $skinDir->read())) {
- if(preg_match('/^([^.].*)\.php$/',$file, $matches)) {
+ // Skip non-PHP files, hidden files, and '.dep' includes
+ if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
$aSkin = $matches[1];
$wgValidSkinNames[strtolower($aSkin)] = $aSkin;
}
unset($matches);
/**
- * The main skin class that provide methods and properties for all other skins
- * including PHPTal skins.
+ * The main skin class that provide methods and properties for all other skins.
* This base class is also the "Standard" skin.
* @package MediaWiki
*/
global $IP;
- # Grab the skin class and initialise it. Each skin checks for PHPTal
- # and will not load if it's not enabled.
+ # Grab the skin class and initialise it.
+ wfSuppressWarnings();
+ // Preload base classes to work around APC/PHP5 bug
+ include_once( $IP.'/skins/'.$skinName.'.deps.php' );
+ wfRestoreWarnings();
require_once( $IP.'/skins/'.$skinName.'.php' );
# Check if we got if not failback to default skin
}
function initPage( &$out ) {
+ global $wgFavicon;
+
$fname = 'Skin::initPage';
wfProfileIn( $fname );
- $out->addLink( array( 'rel' => 'shortcut icon', 'href' => '/favicon.ico' ) );
+ if( false !== $wgFavicon ) {
+ $out->addLink( array( 'rel' => 'shortcut icon', 'href' => $wgFavicon ) );
+ }
$this->addMetadataLinks($out);
$wgRequest->getVal( 'wpEditToken' ) );
}
- # get the user/site-specific stylesheet, SkinPHPTal called from RawPage.php (settings are cached that way)
+ # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way)
function getUserStylesheet() {
global $wgOut, $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
$sheet = $this->getStylesheet();
wfMsg( 'postcomment' ), 'action=edit§ion=new' );
}
- /* these are used extensively in SkinPHPTal, but also some other places */
+ /* these are used extensively in SkinTemplate, but also some other places */
/*static*/ function makeSpecialUrl( $name, $urlaction='' ) {
$title = Title::makeTitle( NS_SPECIAL, $name );
return $title->getLocalURL( $urlaction );
*/
function buildSidebar() {
global $wgTitle, $action, $wgDBname, $parserMemc;
+ global $wgLanguageCode, $wgContLanguageCode;
$fname = 'SkinTemplate::buildSidebar';
wfProfileIn( $fname );
- $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar");
- if ($cachedsidebar!="") {
- wfProfileOut($fname);
- return $cachedsidebar;
+
+ if ($wgLanguageCode == $wgContLanguageCode)
+ $cacheSidebar = true;
+ else
+ $cacheSidebar = false;
+
+ if ($cacheSidebar) {
+ $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar");
+ if ($cachedsidebar!="") {
+ wfProfileOut($fname);
+ return $cachedsidebar;
+ }
}
$bar = array();
} else { continue; }
}
}
-
- $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400);
+ if ($cacheSidebar)
+ $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400);
wfProfileOut( $fname );
return $bar;
}