Go to the documentation of this file.
45 public static function factory( $prefix, $extension =
'' ) {
48 $ext = ( $extension !=
'' ) ?
".{$extension}" :
"";
49 for ( $attempt = 1;
true; $attempt++ ) {
50 $path =
"{$base}-{$attempt}{$ext}";
52 $newFileHandle = fopen(
$path,
'x' );
54 if ( $newFileHandle ) {
55 fclose( $newFileHandle );
58 if ( $attempt >= 5 ) {
64 $tmpFile =
new self(
$path );
65 $tmpFile->canDelete =
true;
76 public function purge() {
77 $this->canDelete =
false;
79 $ok = unlink( $this->path );
91 public function bind( $object ) {
92 if ( is_object( $object ) ) {
93 if ( !isset( $object->tempFSFileReferences ) ) {
95 $object->tempFSFileReferences =
array();
97 $object->tempFSFileReferences[] = $this;
109 $this->canDelete =
false;
120 $this->canDelete =
true;
129 if ( $this->canDelete ) {
131 unlink( $this->path );
bool $canDelete
Garbage collect the temp file *.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
wfProfileIn( $functionname)
Begin profiling of a function.
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
purge()
Purge this file off the file system.
string $path
Path to file *.
wfRestoreWarnings()
Restore error level to previous value.
wfProfileOut( $functionname='missing')
Stop profiling of a function.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
bind( $object)
Clean up the temporary file only after an object goes out of scope.
static factory( $prefix, $extension='')
Make a new temporary file on the file system.
This class is used to hold the location and do limited manipulation of files stored temporarily (this...
Class representing a non-directory file on the file system.
autocollect()
Set flag clean up after the temporary file.
__destruct()
Cleans up after the temporary file by deleting it.
wfTempDir()
Tries to get the system directory for temporary files.
preserve()
Set flag to not clean up after the temporary file.
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.