r44990 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44989‎ | r44990 | r44991 >
Date:23:34, 23 December 2008
Author:brion
Status:ok
Tags:
Comment:
Revert r44814 "code style tweaks" -- removal of class_exists check breaks actual maint scripts
Modified paths:
  • /trunk/phase3/includes/Setup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Setup.php
@@ -22,7 +22,7 @@
2323 wfProfileIn( $fname );
2424
2525 // Check to see if we are at the file scope
26 -if( !isset( $wgVersion ) ) {
 26+if ( !isset( $wgVersion ) ) {
2727 echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
2828 die( 1 );
2929 }
@@ -33,9 +33,9 @@
3434
3535 if( $wgArticlePath === false ) {
3636 if( $wgUsePathInfo ) {
37 - $wgArticlePath = "$wgScript/$1";
 37+ $wgArticlePath = "$wgScript/$1";
3838 } else {
39 - $wgArticlePath = "$wgScript?title=$1";
 39+ $wgArticlePath = "$wgScript?title=$1";
4040 }
4141 }
4242
@@ -54,7 +54,7 @@
5555 if( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
5656 if( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
5757
58 -if( empty( $wgFileStore['deleted']['directory'] ) ) {
 58+if ( empty( $wgFileStore['deleted']['directory'] ) ) {
5959 $wgFileStore['deleted']['directory'] = "{$wgUploadDirectory}/deleted";
6060 }
6161
@@ -78,7 +78,7 @@
7979 /**
8080 * Initialise $wgLocalFileRepo from backwards-compatible settings
8181 */
82 -if( !$wgLocalFileRepo ) {
 82+if ( !$wgLocalFileRepo ) {
8383 $wgLocalFileRepo = array(
8484 'class' => 'LocalRepo',
8585 'name' => 'local',
@@ -95,8 +95,8 @@
9696 /**
9797 * Initialise shared repo from backwards-compatible settings
9898 */
99 -if( $wgUseSharedUploads ) {
100 - if( $wgSharedUploadDBname ) {
 99+if ( $wgUseSharedUploads ) {
 100+ if ( $wgSharedUploadDBname ) {
101101 $wgForeignFileRepos[] = array(
102102 'class' => 'ForeignDBRepo',
103103 'name' => 'shared',
@@ -130,7 +130,9 @@
131131 );
132132 }
133133 }
134 -require_once( "$IP/includes/AutoLoader.php" );
 134+if ( !class_exists( 'AutoLoader' ) ) {
 135+ require_once( "$IP/includes/AutoLoader.php" );
 136+}
135137
136138 wfProfileIn( $fname.'-exception' );
137139 require_once( "$IP/includes/Exception.php" );
@@ -154,9 +156,9 @@
155157 $wgRequest = new WebRequest;
156158
157159 # Useful debug output
158 -if( $wgCommandLineMode ) {
 160+if ( $wgCommandLineMode ) {
159161 wfDebug( "\n\nStart command line script $self\n" );
160 -} elseif( function_exists( 'getallheaders' ) ) {
 162+} elseif ( function_exists( 'getallheaders' ) ) {
161163 wfDebug( "\n\nStart request\n" );
162164 wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
163165 $headers = getallheaders();
@@ -181,13 +183,13 @@
182184 }
183185 }
184186
185 -if( $wgSkipSkin ) {
 187+if ( $wgSkipSkin ) {
186188 $wgSkipSkins[] = $wgSkipSkin;
187189 }
188190
189191 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
190192
191 -if( $wgMetaNamespace === FALSE ) {
 193+if($wgMetaNamespace === FALSE) {
192194 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
193195 }
194196
@@ -234,7 +236,7 @@
235237 if( !wfIniGetBool( 'session.auto_start' ) )
236238 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
237239
238 -if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset($_COOKIE[$wgCookiePrefix.'Token']) ) ) {
 240+if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) {
239241 wfIncrStats( 'request_with_session' );
240242 wfSetupSession();
241243 $wgSessionStarted = true;
@@ -266,7 +268,7 @@
267269 # Entries can be added to this variable during the inclusion
268270 # of the extension file. Skins can then perform any necessary initialisation.
269271 #
270 -foreach( $wgSkinExtensionFunctions as $func ) {
 272+foreach ( $wgSkinExtensionFunctions as $func ) {
271273 call_user_func( $func );
272274 }
273275
@@ -282,8 +284,8 @@
283285 $wgDeferredUpdateList = array();
284286 $wgPostCommitUpdateList = array();
285287
286 -if( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch';
287 -if( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning';
 288+if ( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch';
 289+if ( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning';
288290 if( $wgAjaxLicensePreview )
289291 $wgAjaxExportList[] = 'UploadForm::ajaxGetLicensePreview';
290292
@@ -298,7 +300,7 @@
299301 # Entries should be added to this variable during the inclusion
300302 # of the extension file. This allows the extension to perform
301303 # any necessary initialisation in the fully initialised environment
302 -foreach( $wgExtensionFunctions as $func ) {
 304+foreach ( $wgExtensionFunctions as $func ) {
303305 $profName = $fname.'-extensions-'.strval( $func );
304306 wfProfileIn( $profName );
305307 call_user_func( $func );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44814Code style tweaksaaron22:32, 19 December 2008

Status & tagging log