$this->lock($cacheKey);
- # Limit the concurrency of loadFromDB to a single process
+ # Limit the concurrency of loadFromDB to a single process
# This prevents the site from going down when the cache expires
$statusKey = wfMemcKey( 'messages', $code, 'status' );
$success = $this->mMemc->add( $statusKey, 'loading', MSG_LOAD_TIMEOUT );
}
# Fix whitespace
- $message = strtr( $message,
+ $message = strtr( $message,
array(
# Fix for trailing whitespace, removed by textarea
' ' => ' ',
function disable() { $this->mDisable = true; }
function enable() { $this->mDisable = false; }
-
+
/** @deprecated */
function disableTransform(){
wfDeprecated( __METHOD__ );
class MWNamespace {
/**
- * These namespaces should always be first-letter capitalized, now and
- * forevermore. Historically, they could've probably been lowercased too,
+ * These namespaces should always be first-letter capitalized, now and
+ * forevermore. Historically, they could've probably been lowercased too,
* but some things are just too ingrained now. :)
*/
private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_USER, NS_MEDIAWIKI );
? $index - 1
: $index;
}
-
+
/**
* Returns whether the specified namespace exists
*/
* @return bool
*/
public static function canTalk( $index ) {
- return $index >= NS_MAIN;
+ return $index >= NS_MAIN;
}
/**
global $wgNamespacesWithSubpages;
return !empty( $wgNamespacesWithSubpages[$index] );
}
-
+
/**
* Is the namespace first-letter capitalized?
- *
+ *
* @param $index int Index to check
* @return bool
*/
global $wgCapitalLinks, $wgCapitalLinkOverrides;
// Turn NS_MEDIA into NS_FILE
$index = $index === NS_MEDIA ? NS_FILE : $index;
-
+
// Make sure to get the subject of our namespace
$index = self::getSubject( $index );
-
+
// Some namespaces are special and should always be upper case
if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
return true;
/**
* @file
* @ingroup upload
- *
+ *
* Implements uploading from a HTTP resource.
- *
+ *
* @author Bryan Tong Minh
* @author Michael Dale
*/
protected $mTempDownloadPath;
/**
- * Checks if the user is allowed to use the upload-by-URL feature. If the
+ * Checks if the user is allowed to use the upload-by-URL feature. If the
* user is allowed, pass on permissions checking to the parent.
*/
public static function isAllowed( $user ) {
return $wgAllowCopyUploads && parent::isEnabled();
}
- /**
- * Entry point for API upload
+ /**
+ * Entry point for API upload
*/
public function initialize( $name, $url, $na, $nb = false ) {
global $wgTmpDirectory;
$desiredDestName = $request->getText( 'wpUploadFileURL' );
return $this->initialize(
$desiredDestName,
- $request->getVal( 'wpUploadFileURL' ),
+ $request->getVal( 'wpUploadFileURL' ),
false
);
}
// Only allow HTTP or FTP for now
return (bool)preg_match( '!^(http://|ftp://)!', $url );
}
-
+
/**
* Do the real fetching stuff
*/
}
return Status::newGood();
}
-
+
/**
* Safe copy from URL
* Returns true if there was an error, false otherwise
fclose( $this->mCurlDestHandle );
unset( $this->mCurlDestHandle );
-
- if( $error )
+
+ if( $error )
return "upload-curl-error$errornum";
return true;
}
-
+
/**
* Callback function for CURL-based web transfer
* Write data to file unless we've passed the length limit;
function uploadCurlCallback( $ch, $data ) {
global $wgMaxUploadSize;
$length = strlen( $data );
- $this->mFileSize += $length;
+ $this->mFileSize += $length;
if( $this->mFileSize > $wgMaxUploadSize ) {
return 0;
}