Index: trunk/phase3/includes/Setup.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | wfProfileIn( $fname ); |
24 | 24 | |
25 | 25 | // Check to see if we are at the file scope |
26 | | -if( !isset( $wgVersion ) ) { |
| 26 | +if ( !isset( $wgVersion ) ) { |
27 | 27 | echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n"; |
28 | 28 | die( 1 ); |
29 | 29 | } |
— | — | @@ -33,9 +33,9 @@ |
34 | 34 | |
35 | 35 | if( $wgArticlePath === false ) { |
36 | 36 | if( $wgUsePathInfo ) { |
37 | | - $wgArticlePath = "$wgScript/$1"; |
| 37 | + $wgArticlePath = "$wgScript/$1"; |
38 | 38 | } else { |
39 | | - $wgArticlePath = "$wgScript?title=$1"; |
| 39 | + $wgArticlePath = "$wgScript?title=$1"; |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | if( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR"; |
56 | 56 | if( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache"; |
57 | 57 | |
58 | | -if( empty( $wgFileStore['deleted']['directory'] ) ) { |
| 58 | +if ( empty( $wgFileStore['deleted']['directory'] ) ) { |
59 | 59 | $wgFileStore['deleted']['directory'] = "{$wgUploadDirectory}/deleted"; |
60 | 60 | } |
61 | 61 | |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | /** |
80 | 80 | * Initialise $wgLocalFileRepo from backwards-compatible settings |
81 | 81 | */ |
82 | | -if( !$wgLocalFileRepo ) { |
| 82 | +if ( !$wgLocalFileRepo ) { |
83 | 83 | $wgLocalFileRepo = array( |
84 | 84 | 'class' => 'LocalRepo', |
85 | 85 | 'name' => 'local', |
— | — | @@ -95,8 +95,8 @@ |
96 | 96 | /** |
97 | 97 | * Initialise shared repo from backwards-compatible settings |
98 | 98 | */ |
99 | | -if( $wgUseSharedUploads ) { |
100 | | - if( $wgSharedUploadDBname ) { |
| 99 | +if ( $wgUseSharedUploads ) { |
| 100 | + if ( $wgSharedUploadDBname ) { |
101 | 101 | $wgForeignFileRepos[] = array( |
102 | 102 | 'class' => 'ForeignDBRepo', |
103 | 103 | 'name' => 'shared', |
— | — | @@ -130,7 +130,9 @@ |
131 | 131 | ); |
132 | 132 | } |
133 | 133 | } |
134 | | -require_once( "$IP/includes/AutoLoader.php" ); |
| 134 | +if ( !class_exists( 'AutoLoader' ) ) { |
| 135 | + require_once( "$IP/includes/AutoLoader.php" ); |
| 136 | +} |
135 | 137 | |
136 | 138 | wfProfileIn( $fname.'-exception' ); |
137 | 139 | require_once( "$IP/includes/Exception.php" ); |
— | — | @@ -154,9 +156,9 @@ |
155 | 157 | $wgRequest = new WebRequest; |
156 | 158 | |
157 | 159 | # Useful debug output |
158 | | -if( $wgCommandLineMode ) { |
| 160 | +if ( $wgCommandLineMode ) { |
159 | 161 | wfDebug( "\n\nStart command line script $self\n" ); |
160 | | -} elseif( function_exists( 'getallheaders' ) ) { |
| 162 | +} elseif ( function_exists( 'getallheaders' ) ) { |
161 | 163 | wfDebug( "\n\nStart request\n" ); |
162 | 164 | wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" ); |
163 | 165 | $headers = getallheaders(); |
— | — | @@ -181,13 +183,13 @@ |
182 | 184 | } |
183 | 185 | } |
184 | 186 | |
185 | | -if( $wgSkipSkin ) { |
| 187 | +if ( $wgSkipSkin ) { |
186 | 188 | $wgSkipSkins[] = $wgSkipSkin; |
187 | 189 | } |
188 | 190 | |
189 | 191 | $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist; |
190 | 192 | |
191 | | -if( $wgMetaNamespace === FALSE ) { |
| 193 | +if($wgMetaNamespace === FALSE) { |
192 | 194 | $wgMetaNamespace = str_replace( ' ', '_', $wgSitename ); |
193 | 195 | } |
194 | 196 | |
— | — | @@ -234,7 +236,7 @@ |
235 | 237 | if( !wfIniGetBool( 'session.auto_start' ) ) |
236 | 238 | session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); |
237 | 239 | |
238 | | -if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset($_COOKIE[$wgCookiePrefix.'Token']) ) ) { |
| 240 | +if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) { |
239 | 241 | wfIncrStats( 'request_with_session' ); |
240 | 242 | wfSetupSession(); |
241 | 243 | $wgSessionStarted = true; |
— | — | @@ -266,7 +268,7 @@ |
267 | 269 | # Entries can be added to this variable during the inclusion |
268 | 270 | # of the extension file. Skins can then perform any necessary initialisation. |
269 | 271 | # |
270 | | -foreach( $wgSkinExtensionFunctions as $func ) { |
| 272 | +foreach ( $wgSkinExtensionFunctions as $func ) { |
271 | 273 | call_user_func( $func ); |
272 | 274 | } |
273 | 275 | |
— | — | @@ -282,8 +284,8 @@ |
283 | 285 | $wgDeferredUpdateList = array(); |
284 | 286 | $wgPostCommitUpdateList = array(); |
285 | 287 | |
286 | | -if( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch'; |
287 | | -if( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning'; |
| 288 | +if ( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch'; |
| 289 | +if ( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning'; |
288 | 290 | if( $wgAjaxLicensePreview ) |
289 | 291 | $wgAjaxExportList[] = 'UploadForm::ajaxGetLicensePreview'; |
290 | 292 | |
— | — | @@ -298,7 +300,7 @@ |
299 | 301 | # Entries should be added to this variable during the inclusion |
300 | 302 | # of the extension file. This allows the extension to perform |
301 | 303 | # any necessary initialisation in the fully initialised environment |
302 | | -foreach( $wgExtensionFunctions as $func ) { |
| 304 | +foreach ( $wgExtensionFunctions as $func ) { |
303 | 305 | $profName = $fname.'-extensions-'.strval( $func ); |
304 | 306 | wfProfileIn( $profName ); |
305 | 307 | call_user_func( $func ); |