summaryrefslogtreecommitdiff
path: root/includes/filebackend/TempFSFile.php
diff options
context:
space:
mode:
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();
}
}