Index: trunk/phase3/includes/WikiMap.php |
— | — | @@ -7,16 +7,9 @@ |
8 | 8 | class WikiMap { |
9 | 9 | static function getWiki( $wikiID ) { |
10 | 10 | global $wgConf, $IP; |
11 | | - static $initialiseSettingsDone = false; |
| 11 | + |
| 12 | + $wgConf->loadFullData(); |
12 | 13 | |
13 | | - // This is a damn dirty hack |
14 | | - if ( !$initialiseSettingsDone ) { |
15 | | - $initialiseSettingsDone = true; |
16 | | - if( file_exists( "$IP/InitialiseSettings.php" ) ) { |
17 | | - require_once "$IP/InitialiseSettings.php"; |
18 | | - } |
19 | | - } |
20 | | - |
21 | 14 | list( $major, $minor ) = $wgConf->siteFromDB( $wikiID ); |
22 | 15 | if( isset( $major ) ) { |
23 | 16 | $server = $wgConf->get( 'wgServer', $wikiID, $major, |
Index: trunk/phase3/includes/SiteConfiguration.php |
— | — | @@ -36,6 +36,14 @@ |
37 | 37 | * Array of domains that are local and can be handled by the same server |
38 | 38 | */ |
39 | 39 | public $localVHosts = array(); |
| 40 | + |
| 41 | + /** |
| 42 | + * Optional callback to load full configuration data. |
| 43 | + */ |
| 44 | + public $fullLoadCallback = null; |
| 45 | + |
| 46 | + /** Whether or not all data has been loaded */ |
| 47 | + public $fullLoadDone = false; |
40 | 48 | |
41 | 49 | /** |
42 | 50 | * A callback function that returns an array with the following keys (all |
— | — | @@ -387,5 +395,12 @@ |
388 | 396 | |
389 | 397 | return $out; |
390 | 398 | } |
| 399 | + |
| 400 | + public function loadFullData() { |
| 401 | + if ($this->fullLoadCallback && !$this->fullLoadDone) { |
| 402 | + call_user_func( $this->fullLoadCallback ); |
| 403 | + $this->fullLoadDone = true; |
| 404 | + } |
| 405 | + } |
391 | 406 | } |
392 | | -} |
| 407 | +} // End of multiple inclusion guard |
Index: trunk/extensions/Configure/Configure.obj.php |
— | — | @@ -244,18 +244,12 @@ |
245 | 245 | * @return array |
246 | 246 | */ |
247 | 247 | public function getDefaultsForWiki( $wiki ) { |
248 | | - ## Hack for Wikimedia |
249 | | - static $initialiseSettingsDone = false; |
250 | | - |
251 | 248 | wfProfileIn( __METHOD__ ); |
252 | 249 | |
253 | | - if ( !$initialiseSettingsDone ) { |
254 | | - $initialiseSettingsDone = true; |
255 | | - global $IP, $wgConf; |
256 | | - if( file_exists( "$IP/InitialiseSettings.php" ) ) { |
257 | | - require_once "$IP/InitialiseSettings.php"; |
258 | | - $this->initialise( false ); |
259 | | - } |
| 250 | + global $wgConf; |
| 251 | + if (!$wgConf->fullLoadDone) { |
| 252 | + $wgConf->loadFullData(); |
| 253 | + $this->initialise( false ); |
260 | 254 | } |
261 | 255 | |
262 | 256 | // Hmm, a better solution would be nice! |
Index: trunk/extensions/CentralNotice/SpecialNoticeText.php |
— | — | @@ -210,10 +210,7 @@ |
211 | 211 | private function projectName() { |
212 | 212 | global $wgConf, $IP; |
213 | 213 | |
214 | | - // This is a damn dirty hack |
215 | | - if ( file_exists( "$IP/InitialiseSettings.php" ) ) { |
216 | | - require_once "$IP/InitialiseSettings.php"; |
217 | | - } |
| 214 | + $wgConf->loadFullData(); |
218 | 215 | |
219 | 216 | // Special cases for commons and meta who have no lang |
220 | 217 | if ( $this->project == 'commons' ) |
Index: trunk/extensions/SiteMatrix/SiteMatrix_body.php |
— | — | @@ -17,9 +17,7 @@ |
18 | 18 | global $wgSiteMatrixFile, $wgSiteMatrixSites; |
19 | 19 | global $wgLocalDatabases, $IP, $wgConf; |
20 | 20 | |
21 | | - if( file_exists( "$IP/InitialiseSettings.php" ) ) { |
22 | | - require_once "$IP/InitialiseSettings.php"; |
23 | | - } |
| 21 | + $wgConf->loadFullData(); |
24 | 22 | |
25 | 23 | if( file_exists( $wgSiteMatrixFile ) ){ |
26 | 24 | $this->langlist = array_map( 'trim', file( $wgSiteMatrixFile ) ); |