* @ingroup FileBackend
*/
class TempFSFile extends FSFile {
- protected $canDelete = false; // bool; garbage collect the temp file
+ /** @var bool Garbage collect the temp file */
+ protected $canDelete = false;
- /** @var Array of active temp files to purge on shutdown */
+ /** @var array Active temp files to purge on shutdown */
protected static $instances = array();
/**
}
if ( $attempt >= 5 ) {
wfProfileOut( __METHOD__ );
+
return null; // give up
}
}
$tmpFile = new self( $path );
$tmpFile->canDelete = true; // safely instantiated
wfProfileOut( __METHOD__ );
+
return $tmpFile;
}
wfSuppressWarnings();
$ok = unlink( $this->path );
wfRestoreWarnings();
+
return $ok;
}
/**
* Clean up the temporary file only after an object goes out of scope
*
- * @param Object $object
+ * @param stdClass $object
* @return TempFSFile This object
*/
public function bind( $object ) {
}
$object->tempFSFileReferences[] = $this;
}
+
return $this;
}
*/
public function preserve() {
$this->canDelete = false;
+
return $this;
}
*/
public function autocollect() {
$this->canDelete = true;
+
return $this;
}