Creating a Temporary File
Creating a Temporary File
- public function __construct($filename, $root_directory) — Create a new temporary file.
Configuration
Configuration
- public function setPreserveFile($preserve) — Normally, the file is deleted when this object passes out of scope. You can set it to be preserved instead.
Internals
Internals
- public function __toString() — Get the path to the temporary file. Normally you can just use the object in a string context.
- public function __destruct() — When the object is destroyed, it destroys the temporary file. You can change this behavior with @{method:setPreserveFile}.