Index: trunk/phase3/includes/Setup.php |
— | — | @@ -56,9 +56,14 @@ |
57 | 57 | require_once( 'Hooks.php' ); |
58 | 58 | require_once( 'Namespace.php' ); |
59 | 59 | require_once( 'User.php' ); |
| 60 | +require_once( 'Skin.php' ); |
| 61 | +require_once( 'OutputPage.php' ); |
60 | 62 | require_once( 'MagicWord.php' ); |
| 63 | +require_once( 'Block.php' ); |
| 64 | +require_once( 'MessageCache.php' ); |
61 | 65 | require_once( 'Parser.php' ); |
62 | 66 | require_once( 'LoadBalancer.php' ); |
| 67 | +require_once( 'HistoryBlob.php' ); |
63 | 68 | require_once( 'ProxyTools.php' ); |
64 | 69 | require_once( 'ObjectCache.php' ); |
65 | 70 | require_once( 'SpecialPage.php' ); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1163,7 +1163,8 @@ |
1164 | 1164 | * Check that the corresponding skin exists |
1165 | 1165 | */ |
1166 | 1166 | function isValidCssJsSubpage() { |
1167 | | - return( $this->isCssJsSubpage() && array_key_exists( $this->getSkinFromCssJsSubpage(), Skin::getSkinNames() ) ); |
| 1167 | + global $wgValidSkinNames; |
| 1168 | + return( $this->isCssJsSubpage() && array_key_exists( $this->getSkinFromCssJsSubpage(), $wgValidSkinNames ) ); |
1168 | 1169 | } |
1169 | 1170 | /** |
1170 | 1171 | * Trim down a .css or .js subpage title to get the corresponding skin name |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -444,7 +444,7 @@ |
445 | 445 | * @access private |
446 | 446 | */ |
447 | 447 | function mainPrefsForm( $status , $message = '' ) { |
448 | | - global $wgUser, $wgOut, $wgLang, $wgContLang; |
| 448 | + global $wgUser, $wgOut, $wgLang, $wgContLang, $wgValidSkinNames; |
449 | 449 | global $wgAllowRealName, $wgImageLimits, $wgThumbLimits; |
450 | 450 | global $wgDisableLangConversion; |
451 | 451 | global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits; |
— | — | @@ -721,9 +721,9 @@ |
722 | 722 | $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\n" ); |
723 | 723 | $mptitle = Title::newMainPage(); |
724 | 724 | $previewtext = wfMsg('skinpreview'); |
725 | | - # Only show members of Skin::getSkinNames() rather than |
| 725 | + # Only show members of $wgValidSkinNames rather than |
726 | 726 | # $skinNames (skins is all skin names from Language.php) |
727 | | - foreach (Skin::getSkinNames() as $skinkey => $skinname ) { |
| 727 | + foreach ($wgValidSkinNames as $skinkey => $skinname ) { |
728 | 728 | if ( in_array( $skinkey, $wgSkipSkins ) ) { |
729 | 729 | continue; |
730 | 730 | } |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -9,8 +9,27 @@ |
10 | 10 | */ |
11 | 11 | |
12 | 12 | # See skin.txt |
| 13 | +require_once( 'Linker.php' ); |
13 | 14 | require_once( 'Image.php' ); |
14 | 15 | |
| 16 | +# Get a list of available skins |
| 17 | +# Build using the regular expression '^(.*).php$' |
| 18 | +# Array keys are all lower case, array value keep the case used by filename |
| 19 | +# |
| 20 | + |
| 21 | +$skinDir = dir( $wgStyleDirectory ); |
| 22 | + |
| 23 | +# while code from www.php.net |
| 24 | +while (false !== ($file = $skinDir->read())) { |
| 25 | + // Skip non-PHP files, hidden files, and '.dep' includes |
| 26 | + if(preg_match('/^([^.]*)\.php$/',$file, $matches)) { |
| 27 | + $aSkin = $matches[1]; |
| 28 | + $wgValidSkinNames[strtolower($aSkin)] = $aSkin; |
| 29 | + } |
| 30 | +} |
| 31 | +$skinDir->close(); |
| 32 | +unset($matches); |
| 33 | + |
15 | 34 | /** |
16 | 35 | * The main skin class that provide methods and properties for all other skins. |
17 | 36 | * This base class is also the "Standard" skin. |
— | — | @@ -25,8 +44,6 @@ |
26 | 45 | var $rcCacheIndex ; # Recent Changes Cache Counter for visibility toggle |
27 | 46 | var $rcMoveIndex; |
28 | 47 | /**#@-*/ |
29 | | - |
30 | | - private static $validSkinNames; |
31 | 48 | |
32 | 49 | /** Constructor, call parent constructor */ |
33 | 50 | function Skin() { parent::Linker(); } |
— | — | @@ -37,33 +54,10 @@ |
38 | 55 | * @static |
39 | 56 | */ |
40 | 57 | function getSkinNames() { |
41 | | - if (!is_array(Skin::$validSkinNames)) { |
42 | | - Skin::initializeSkinNames(); |
43 | | - } |
44 | | - return Skin::$validSkinNames; |
| 58 | + global $wgValidSkinNames; |
| 59 | + return $wgValidSkinNames; |
45 | 60 | } |
46 | 61 | |
47 | | - |
48 | | - /** Initialize a list of available skins |
49 | | - * Build using the regular expression '^(.*).php$' |
50 | | - * Array keys are all lower case, array value keep the case used by filename |
51 | | - */ |
52 | | - |
53 | | - function initializeSkinNames() { |
54 | | - global $wgStyleDirectory; |
55 | | - $skinDir = dir( $wgStyleDirectory ); |
56 | | - |
57 | | - # while code from www.php.net |
58 | | - while (false !== ($file = $skinDir->read())) { |
59 | | - // Skip non-PHP files, hidden files, and '.dep' includes |
60 | | - if(preg_match('/^([^.]*)\.php$/',$file, $matches)) { |
61 | | - $aSkin = $matches[1]; |
62 | | - Skin::$validSkinNames[strtolower($aSkin)] = $aSkin; |
63 | | - } |
64 | | - } |
65 | | - $skinDir->close(); |
66 | | - } |
67 | | - |
68 | 62 | /** |
69 | 63 | * Normalize a skin preference value to a form that can be loaded. |
70 | 64 | * If a skin can't be found, it will fall back to the configured |
Index: trunk/phase3/includes/HistoryBlob.php |
— | — | @@ -174,14 +174,15 @@ |
175 | 175 | * the same blob. By keeping the last-used one open, we avoid |
176 | 176 | * redundant unserialization and decompression overhead. |
177 | 177 | */ |
| 178 | +global $wgBlobCache; |
| 179 | +$wgBlobCache = array(); |
178 | 180 | |
| 181 | + |
179 | 182 | /** |
180 | 183 | * @package MediaWiki |
181 | 184 | */ |
182 | 185 | class HistoryBlobStub { |
183 | 186 | var $mOldId, $mHash, $mRef; |
184 | | - |
185 | | - static private $blobCache = array(); |
186 | 187 | |
187 | 188 | /** @todo document */ |
188 | 189 | function HistoryBlobStub( $hash = '', $oldid = 0 ) { |
— | — | @@ -213,8 +214,9 @@ |
214 | 215 | /** @todo document */ |
215 | 216 | function getText() { |
216 | 217 | $fname = 'HistoryBlob::getText'; |
217 | | - if( isset( HistoryBlobStub::$blobCache[$this->mOldId] ) ) { |
218 | | - $obj = HistoryBlobStub::$blobCache[$this->mOldId]; |
| 218 | + global $wgBlobCache; |
| 219 | + if( isset( $wgBlobCache[$this->mOldId] ) ) { |
| 220 | + $obj = $wgBlobCache[$this->mOldId]; |
219 | 221 | } else { |
220 | 222 | $dbr =& wfGetDB( DB_SLAVE ); |
221 | 223 | $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) ); |
— | — | @@ -253,7 +255,7 @@ |
254 | 256 | // Save this item for reference; if pulling many |
255 | 257 | // items in a row we'll likely use it again. |
256 | 258 | $obj->uncompress(); |
257 | | - HistoryBlobStub::$blobCache = array( $this->mOldId => $obj ); |
| 259 | + $wgBlobCache = array( $this->mOldId => $obj ); |
258 | 260 | } |
259 | 261 | return $obj->getItem( $this->mHash ); |
260 | 262 | } |