// see if it now doesn't exist; reload
$title = Title::newFromText( $title->getText(), NS_FILE );
}
- return ! ( $title && $title instanceof Title && $title->exists() );
+
+ return !( $title && $title instanceof Title && $title->exists() );
}
/**
foreach ( $dupes as $dupe ) {
$success &= $this->deleteFileByTitle( $dupe->getTitle() );
}
+
return $success;
}
$tmpName = tempnam( wfTempDir(), "" );
if ( !file_exists( $filePath ) ) {
throw new Exception( "$filePath doesn't exist!" );
- };
+ }
if ( !copy( $filePath, $tmpName ) ) {
throw new Exception( "couldn't copy $filePath to $tmpName" );
throw new Exception( "couldn't stat $tmpName" );
}
- $_FILES[ $fieldName ] = array(
- 'name' => $fileName,
- 'type' => $type,
- 'tmp_name' => $tmpName,
- 'size' => $size,
- 'error' => null
+ $_FILES[$fieldName] = array(
+ 'name' => $fileName,
+ 'type' => $type,
+ 'tmp_name' => $tmpName,
+ 'size' => $size,
+ 'error' => null
);
return true;
-
}
- function fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData ) {
+ function fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData ) {
$tmpName = tempnam( wfTempDir(), "" );
// copy the chunk data to temp location:
if ( !file_put_contents( $tmpName, $chunkData ) ) {
throw new Exception( "couldn't stat $tmpName" );
}
- $_FILES[ $fieldName ] = array(
- 'name' => $fileName,
- 'type' => $type,
- 'tmp_name' => $tmpName,
- 'size' => $size,
- 'error' => null
+ $_FILES[$fieldName] = array(
+ 'name' => $fileName,
+ 'type' => $type,
+ 'tmp_name' => $tmpName,
+ 'size' => $size,
+ 'error' => null
);
}
function clearTempUpload() {
- if( isset( $_FILES['file']['tmp_name'] ) ) {
+ if ( isset( $_FILES['file']['tmp_name'] ) ) {
$tmp = $_FILES['file']['tmp_name'];
- if( file_exists( $tmp ) ) {
+ if ( file_exists( $tmp ) ) {
unlink( $tmp );
}
}
function clearFakeUploads() {
$_FILES = array();
}
-
}