Index: trunk/extensions/Farmer/SpecialFarmer.php |
— | — | @@ -282,7 +282,7 @@ |
283 | 283 | $list = $wgFarmer->getFarmList(); |
284 | 284 | |
285 | 285 | $wgOut->wrapWikiMsg( "== $1 ==", 'farmer-listofwikis' ); |
286 | | - $current = MediaWikiFarmer::getActiveWiki()->name; |
| 286 | + $current = $wgFarmer->getActiveWiki()->name; |
287 | 287 | |
288 | 288 | foreach ( $list as $wiki ) { |
289 | 289 | $link = ( $current == $wiki['name'] ? wfMsgForContent( 'mainpage' ) : $wiki['name'] . ':' ); |
Index: trunk/extensions/Farmer/MediaWikiFarmer.php |
— | — | @@ -52,21 +52,17 @@ |
53 | 53 | protected $_sharedGroups = false; |
54 | 54 | protected $_extensionsLoaded = false; |
55 | 55 | |
| 56 | + /** Instance of MediaWikiFarmer_Wiki */ |
| 57 | + protected $_activeWiki = null; |
| 58 | + |
56 | 59 | /** Instance of this class */ |
57 | 60 | protected static $_instance = null; |
58 | 61 | |
59 | | - /** Instance of MediaWikiFarmer_Wiki */ |
60 | | - protected static $_activeWiki = null; |
61 | 62 | |
62 | | - |
63 | 63 | public static function getInstance() { |
64 | 64 | return self::$_instance; |
65 | 65 | } |
66 | 66 | |
67 | | - public static function getActiveWiki() { |
68 | | - return self::$_activeWiki; |
69 | | - } |
70 | | - |
71 | 67 | /** |
72 | 68 | * Constructor |
73 | 69 | * |
— | — | @@ -126,6 +122,13 @@ |
127 | 123 | } |
128 | 124 | |
129 | 125 | /** |
| 126 | + * Get the active wiki for this MediaWikiFarmer instance |
| 127 | + */ |
| 128 | + public function getActiveWiki() { |
| 129 | + return $this->_activeWiki; |
| 130 | + } |
| 131 | + |
| 132 | + /** |
130 | 133 | * Runs MediaWikiFarmer |
131 | 134 | * |
132 | 135 | * This function does all the fun stuff |
— | — | @@ -164,9 +167,8 @@ |
165 | 168 | */ |
166 | 169 | protected function _doWiki( $wiki ){ |
167 | 170 | $wiki = MediaWikiFarmer_Wiki::factory( $wiki ); |
| 171 | + $this->_activeWiki = $wiki; |
168 | 172 | |
169 | | - self::$_activeWiki = $wiki; |
170 | | - |
171 | 173 | if( !$wiki->exists() ){ |
172 | 174 | // if the default wiki doesn't exist (probably first-time user) |
173 | 175 | if ( $wiki->isDefaultWiki() ) { |