summaryrefslogtreecommitdiff
path: root/includes/filebackend/TempFSFile.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/filebackend/TempFSFile.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/filebackend/TempFSFile.php')
-rw-r--r--includes/filebackend/TempFSFile.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/includes/filebackend/TempFSFile.php b/includes/filebackend/TempFSFile.php
index 791be7fc..46b53600 100644
--- a/includes/filebackend/TempFSFile.php
+++ b/includes/filebackend/TempFSFile.php
@@ -59,15 +59,14 @@ class TempFSFile extends FSFile {
$ext = ( $extension != '' ) ? ".{$extension}" : "";
for ( $attempt = 1; true; $attempt++ ) {
$path = "{$base}-{$attempt}{$ext}";
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$newFileHandle = fopen( $path, 'x' );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( $newFileHandle ) {
fclose( $newFileHandle );
break; // got it
}
if ( $attempt >= 5 ) {
-
return null; // give up
}
}
@@ -84,9 +83,9 @@ class TempFSFile extends FSFile {
*/
public function purge() {
$this->canDelete = false; // done
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$ok = unlink( $this->path );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
unset( self::$pathsCollect[$this->path] );
@@ -96,7 +95,7 @@ class TempFSFile extends FSFile {
/**
* Clean up the temporary file only after an object goes out of scope
*
- * @param stdClass $object
+ * @param object $object
* @return TempFSFile This object
*/
public function bind( $object ) {
@@ -144,9 +143,9 @@ class TempFSFile extends FSFile {
*/
public static function purgeAllOnShutdown() {
foreach ( self::$pathsCollect as $path ) {
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
unlink( $path );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
}
}