revert back to 14660
authorDomas Mituzas <midom@users.mediawiki.org>
Thu, 8 Jun 2006 15:12:26 +0000 (15:12 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Thu, 8 Jun 2006 15:12:26 +0000 (15:12 +0000)
includes/HistoryBlob.php
includes/Setup.php
includes/Skin.php
includes/SpecialPreferences.php
includes/Title.php

index 85c41e0..8f5d362 100644 (file)
@@ -174,14 +174,15 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob
  * the same blob. By keeping the last-used one open, we avoid
  * redundant unserialization and decompression overhead.
  */
+global $wgBlobCache;
+$wgBlobCache = array();
+
 
 /**
  * @package MediaWiki
  */
 class HistoryBlobStub {
        var $mOldId, $mHash, $mRef;
-       
-       static private $blobCache = array();
 
        /** @todo document */
        function HistoryBlobStub( $hash = '', $oldid = 0 ) {
@@ -213,8 +214,9 @@ class HistoryBlobStub {
        /** @todo document */
        function getText() {
                $fname = 'HistoryBlob::getText';
-               if( isset( HistoryBlobStub::$blobCache[$this->mOldId] ) ) {
-                       $obj = HistoryBlobStub::$blobCache[$this->mOldId];
+               global $wgBlobCache;
+               if( isset( $wgBlobCache[$this->mOldId] ) ) {
+                       $obj = $wgBlobCache[$this->mOldId];
                } else {
                        $dbr =& wfGetDB( DB_SLAVE );
                        $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) );
@@ -253,7 +255,7 @@ class HistoryBlobStub {
                        // Save this item for reference; if pulling many
                        // items in a row we'll likely use it again.
                        $obj->uncompress();
-                       HistoryBlobStub::$blobCache = array( $this->mOldId => $obj );
+                       $wgBlobCache = array( $this->mOldId => $obj );
                }
                return $obj->getItem( $this->mHash );
        }
index 2ead1b2..3901142 100644 (file)
@@ -56,9 +56,14 @@ require_once( 'GlobalFunctions.php' );
 require_once( 'Hooks.php' );
 require_once( 'Namespace.php' );
 require_once( 'User.php' );
+require_once( 'Skin.php' );
+require_once( 'OutputPage.php' );
 require_once( 'MagicWord.php' );
+require_once( 'Block.php' );
+require_once( 'MessageCache.php' );
 require_once( 'Parser.php' );
 require_once( 'LoadBalancer.php' );
+require_once( 'HistoryBlob.php' );
 require_once( 'ProxyTools.php' );
 require_once( 'ObjectCache.php' );
 require_once( 'SpecialPage.php' );
index bf6c9c3..dc14640 100644 (file)
@@ -9,8 +9,27 @@ if ( ! defined( 'MEDIAWIKI' ) )
  */
 
 # See skin.txt
+require_once( 'Linker.php' );
 require_once( 'Image.php' );
 
+# Get a list of available skins
+# Build using the regular expression '^(.*).php$'
+# Array keys are all lower case, array value keep the case used by filename
+#
+
+$skinDir = dir( $wgStyleDirectory );
+
+# while code from www.php.net
+while (false !== ($file = $skinDir->read())) {
+       // Skip non-PHP files, hidden files, and '.dep' includes
+       if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
+               $aSkin = $matches[1];
+               $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
+       }
+}
+$skinDir->close();
+unset($matches);
+
 /**
  * The main skin class that provide methods and properties for all other skins.
  * This base class is also the "Standard" skin.
@@ -25,8 +44,6 @@ class Skin extends Linker {
        var $rcCacheIndex ; # Recent Changes Cache Counter for visibility toggle
        var $rcMoveIndex;
        /**#@-*/
-       
-       private static $validSkinNames;
 
        /** Constructor, call parent constructor */
        function Skin() { parent::Linker(); }
@@ -37,31 +54,8 @@ class Skin extends Linker {
         * @static
         */
        function getSkinNames() {
-               if (!is_array(Skin::$validSkinNames)) {
-                       Skin::initializeSkinNames();
-               }
-               return Skin::$validSkinNames;
-       }
-
-
-       /** Initialize a list of available skins
-        * Build using the regular expression '^(.*).php$'
-        * Array keys are all lower case, array value keep the case used by filename
-        */
-       
-       function initializeSkinNames() {
-               global $wgStyleDirectory;
-               $skinDir = dir( $wgStyleDirectory );
-               
-               # while code from www.php.net
-               while (false !== ($file = $skinDir->read())) {
-                       // Skip non-PHP files, hidden files, and '.dep' includes
-                       if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
-                               $aSkin = $matches[1];
-                               Skin::$validSkinNames[strtolower($aSkin)] = $aSkin;
-                       }
-               }
-               $skinDir->close();
+               global $wgValidSkinNames;
+               return $wgValidSkinNames;
        }
 
        /**
index 704b548..1ade307 100644 (file)
@@ -444,7 +444,7 @@ class PreferencesForm {
         * @access private
         */
        function mainPrefsForm( $status , $message = '' ) {
-               global $wgUser, $wgOut, $wgLang, $wgContLang;
+               global $wgUser, $wgOut, $wgLang, $wgContLang, $wgValidSkinNames;
                global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
                global $wgDisableLangConversion;
                global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits;
@@ -721,9 +721,9 @@ class PreferencesForm {
                $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\n" );
                $mptitle = Title::newMainPage();
                $previewtext = wfMsg('skinpreview');
-               # Only show members of Skin::getSkinNames() rather than
+               # Only show members of $wgValidSkinNames rather than
                # $skinNames (skins is all skin names from Language.php)
-               foreach (Skin::getSkinNames() as $skinkey => $skinname ) {
+               foreach ($wgValidSkinNames as $skinkey => $skinname ) {
                        if ( in_array( $skinkey, $wgSkipSkins ) ) {
                                continue;
                        }
index 70c0029..75acdec 100644 (file)
@@ -1163,7 +1163,8 @@ class Title {
         * Check that the corresponding skin exists
         */
        function isValidCssJsSubpage() {
-               return( $this->isCssJsSubpage() && array_key_exists( $this->getSkinFromCssJsSubpage(), Skin::getSkinNames() ) );
+               global $wgValidSkinNames;
+               return( $this->isCssJsSubpage() && array_key_exists( $this->getSkinFromCssJsSubpage(), $wgValidSkinNames ) );
        }
        /**
         * Trim down a .css or .js subpage title to get the corresponding skin name