MediaWiki  REL1_24
TempFSFile Class Reference

This class is used to hold the location and do limited manipulation of files stored temporarily (this will be whatever wfTempDir() returns) More...

Inheritance diagram for TempFSFile:
Collaboration diagram for TempFSFile:

List of all members.

Public Member Functions

 __construct ($path)
 Sets up the file object.
 __destruct ()
 Cleans up after the temporary file by deleting it.
 autocollect ()
 Set flag clean up after the temporary file.
 bind ($object)
 Clean up the temporary file only after an object goes out of scope.
 preserve ()
 Set flag to not clean up after the temporary file.
 purge ()
 Purge this file off the file system.

Static Public Member Functions

static factory ($prefix, $extension= '')
 Make a new temporary file on the file system.
static purgeAllOnShutdown ()
 Try to make sure that all files are purged on error.

Protected Attributes

bool $canDelete = false
 Garbage collect the temp file *.

Static Protected Attributes

static $instances = array()
static $pathsCollect = null

Detailed Description

This class is used to hold the location and do limited manipulation of files stored temporarily (this will be whatever wfTempDir() returns)

Definition at line 30 of file TempFSFile.php.


Constructor & Destructor Documentation

Sets up the file object.

Parameters:
string$pathPath to temporary file on local disk

Reimplemented from FSFile.

Definition at line 39 of file TempFSFile.php.

References FSFile\$path, and array().

Cleans up after the temporary file by deleting it.

Definition at line 158 of file TempFSFile.php.


Member Function Documentation

Set flag clean up after the temporary file.

Returns:
TempFSFile This object

Definition at line 134 of file TempFSFile.php.

TempFSFile::bind ( object)

Clean up the temporary file only after an object goes out of scope.

Parameters:
stdClass$object
Returns:
TempFSFile This object

Definition at line 104 of file TempFSFile.php.

static TempFSFile::factory ( prefix,
extension = '' 
) [static]

Make a new temporary file on the file system.

Temporary files may be purged when the file object falls out of scope.

Parameters:
string$prefix
string$extension
Returns:
TempFSFile|null

Definition at line 56 of file TempFSFile.php.

Referenced by MemoryFileBackend\doGetLocalCopyMulti(), ApiImageRotate\execute(), and UploadFromUrl\makeTemporaryFile().

Set flag to not clean up after the temporary file.

Returns:
TempFSFile This object

Definition at line 121 of file TempFSFile.php.

Purge this file off the file system.

Returns:
bool Success

Definition at line 87 of file TempFSFile.php.

static TempFSFile::purgeAllOnShutdown ( ) [static]

Try to make sure that all files are purged on error.

This method should only be called internally

Definition at line 147 of file TempFSFile.php.


Member Data Documentation

bool TempFSFile::$canDelete = false [protected]

Garbage collect the temp file *.

Definition at line 31 of file TempFSFile.php.

TempFSFile::$instances = array() [static, protected]

Definition at line 34 of file TempFSFile.php.

TempFSFile::$pathsCollect = null [static, protected]

Definition at line 37 of file TempFSFile.php.


The documentation for this class was generated from the following file: