r62008 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62007‎ | r62008 | r62009 >
Date:04:25, 5 February 2010
Author:mah
Status:ok
Tags:
Comment:
Random whitespace cleanup
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/Namespace.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -2,9 +2,9 @@
33 /**
44 * @file
55 * @ingroup upload
6 - *
 6+ *
77 * Implements uploading from a HTTP resource.
8 - *
 8+ *
99 * @author Bryan Tong Minh
1010 * @author Michael Dale
1111 */
@@ -12,7 +12,7 @@
1313 protected $mTempDownloadPath;
1414
1515 /**
16 - * Checks if the user is allowed to use the upload-by-URL feature. If the
 16+ * Checks if the user is allowed to use the upload-by-URL feature. If the
1717 * user is allowed, pass on permissions checking to the parent.
1818 */
1919 public static function isAllowed( $user ) {
@@ -29,8 +29,8 @@
3030 return $wgAllowCopyUploads && parent::isEnabled();
3131 }
3232
33 - /**
34 - * Entry point for API upload
 33+ /**
 34+ * Entry point for API upload
3535 */
3636 public function initialize( $name, $url, $na, $nb = false ) {
3737 global $wgTmpDirectory;
@@ -51,7 +51,7 @@
5252 $desiredDestName = $request->getText( 'wpUploadFileURL' );
5353 return $this->initialize(
5454 $desiredDestName,
55 - $request->getVal( 'wpUploadFileURL' ),
 55+ $request->getVal( 'wpUploadFileURL' ),
5656 false
5757 );
5858 }
@@ -70,7 +70,7 @@
7171 // Only allow HTTP or FTP for now
7272 return (bool)preg_match( '!^(http://|ftp://)!', $url );
7373 }
74 -
 74+
7575 /**
7676 * Do the real fetching stuff
7777 */
@@ -84,7 +84,7 @@
8585 }
8686 return Status::newGood();
8787 }
88 -
 88+
8989 /**
9090 * Safe copy from URL
9191 * Returns true if there was an error, false otherwise
@@ -111,13 +111,13 @@
112112
113113 fclose( $this->mCurlDestHandle );
114114 unset( $this->mCurlDestHandle );
115 -
116 - if( $error )
 115+
 116+ if( $error )
117117 return "upload-curl-error$errornum";
118118
119119 return true;
120120 }
121 -
 121+
122122 /**
123123 * Callback function for CURL-based web transfer
124124 * Write data to file unless we've passed the length limit;
@@ -127,7 +127,7 @@
128128 function uploadCurlCallback( $ch, $data ) {
129129 global $wgMaxUploadSize;
130130 $length = strlen( $data );
131 - $this->mFileSize += $length;
 131+ $this->mFileSize += $length;
132132 if( $this->mFileSize > $wgMaxUploadSize ) {
133133 return 0;
134134 }
Index: trunk/phase3/includes/MessageCache.php
@@ -256,7 +256,7 @@
257257
258258 $this->lock($cacheKey);
259259
260 - # Limit the concurrency of loadFromDB to a single process
 260+ # Limit the concurrency of loadFromDB to a single process
261261 # This prevents the site from going down when the cache expires
262262 $statusKey = wfMemcKey( 'messages', $code, 'status' );
263263 $success = $this->mMemc->add( $statusKey, 'loading', MSG_LOAD_TIMEOUT );
@@ -562,7 +562,7 @@
563563 }
564564
565565 # Fix whitespace
566 - $message = strtr( $message,
 566+ $message = strtr( $message,
567567 array(
568568 # Fix for trailing whitespace, removed by textarea
569569 ' ' => ' ',
@@ -677,7 +677,7 @@
678678
679679 function disable() { $this->mDisable = true; }
680680 function enable() { $this->mDisable = false; }
681 -
 681+
682682 /** @deprecated */
683683 function disableTransform(){
684684 wfDeprecated( __METHOD__ );
Index: trunk/phase3/includes/Namespace.php
@@ -46,8 +46,8 @@
4747 class MWNamespace {
4848
4949 /**
50 - * These namespaces should always be first-letter capitalized, now and
51 - * forevermore. Historically, they could've probably been lowercased too,
 50+ * These namespaces should always be first-letter capitalized, now and
 51+ * forevermore. Historically, they could've probably been lowercased too,
5252 * but some things are just too ingrained now. :)
5353 */
5454 private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_USER, NS_MEDIAWIKI );
@@ -107,7 +107,7 @@
108108 ? $index - 1
109109 : $index;
110110 }
111 -
 111+
112112 /**
113113 * Returns whether the specified namespace exists
114114 */
@@ -162,7 +162,7 @@
163163 * @return bool
164164 */
165165 public static function canTalk( $index ) {
166 - return $index >= NS_MAIN;
 166+ return $index >= NS_MAIN;
167167 }
168168
169169 /**
@@ -197,10 +197,10 @@
198198 global $wgNamespacesWithSubpages;
199199 return !empty( $wgNamespacesWithSubpages[$index] );
200200 }
201 -
 201+
202202 /**
203203 * Is the namespace first-letter capitalized?
204 - *
 204+ *
205205 * @param $index int Index to check
206206 * @return bool
207207 */
@@ -208,10 +208,10 @@
209209 global $wgCapitalLinks, $wgCapitalLinkOverrides;
210210 // Turn NS_MEDIA into NS_FILE
211211 $index = $index === NS_MEDIA ? NS_FILE : $index;
212 -
 212+
213213 // Make sure to get the subject of our namespace
214214 $index = self::getSubject( $index );
215 -
 215+
216216 // Some namespaces are special and should always be upper case
217217 if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
218218 return true;

Status & tagging log