r44814 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44813‎ | r44814 | r44815 >
Date:22:32, 19 December 2008
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Code style tweaks
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,9 +130,7 @@
131131 );
132132 }
133133 }
134 -if ( !class_exists( 'AutoLoader' ) ) {
135 - require_once( "$IP/includes/AutoLoader.php" );
136 -}
 134+require_once( "$IP/includes/AutoLoader.php" );
137135
138136 wfProfileIn( $fname.'-exception' );
139137 require_once( "$IP/includes/Exception.php" );
@@ -156,9 +154,9 @@
157155 $wgRequest = new WebRequest;
158156
159157 # Useful debug output
160 -if ( $wgCommandLineMode ) {
 158+if( $wgCommandLineMode ) {
161159 wfDebug( "\n\nStart command line script $self\n" );
162 -} elseif ( function_exists( 'getallheaders' ) ) {
 160+} elseif( function_exists( 'getallheaders' ) ) {
163161 wfDebug( "\n\nStart request\n" );
164162 wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
165163 $headers = getallheaders();
@@ -183,13 +181,13 @@
184182 }
185183 }
186184
187 -if ( $wgSkipSkin ) {
 185+if( $wgSkipSkin ) {
188186 $wgSkipSkins[] = $wgSkipSkin;
189187 }
190188
191189 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
192190
193 -if($wgMetaNamespace === FALSE) {
 191+if( $wgMetaNamespace === FALSE ) {
194192 $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
195193 }
196194
@@ -236,7 +234,7 @@
237235 if( !wfIniGetBool( 'session.auto_start' ) )
238236 session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
239237
240 -if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) {
 238+if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset($_COOKIE[$wgCookiePrefix.'Token']) ) ) {
241239 wfIncrStats( 'request_with_session' );
242240 wfSetupSession();
243241 $wgSessionStarted = true;
@@ -268,7 +266,7 @@
269267 # Entries can be added to this variable during the inclusion
270268 # of the extension file. Skins can then perform any necessary initialisation.
271269 #
272 -foreach ( $wgSkinExtensionFunctions as $func ) {
 270+foreach( $wgSkinExtensionFunctions as $func ) {
273271 call_user_func( $func );
274272 }
275273
@@ -284,8 +282,8 @@
285283 $wgDeferredUpdateList = array();
286284 $wgPostCommitUpdateList = array();
287285
288 -if ( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch';
289 -if ( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning';
 286+if( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch';
 287+if( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning';
290288 if( $wgAjaxLicensePreview )
291289 $wgAjaxExportList[] = 'UploadForm::ajaxGetLicensePreview';
292290
@@ -300,7 +298,7 @@
301299 # Entries should be added to this variable during the inclusion
302300 # of the extension file. This allows the extension to perform
303301 # any necessary initialisation in the fully initialised environment
304 -foreach ( $wgExtensionFunctions as $func ) {
 302+foreach( $wgExtensionFunctions as $func ) {
305303 $profName = $fname.'-extensions-'.strval( $func );
306304 wfProfileIn( $profName );
307305 call_user_func( $func );

Follow-up revisions

RevisionCommit summaryAuthorDate
r44990Revert r44814 "code style tweaks" -- removal of class_exists check breaks act...brion23:34, 23 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   23:36, 23 December 2008

Reverted in r44990 -- change to code behavior (this wasn't just style) broke serialization update scripts in deployment.

Status & tagging log