From 02e746254e0800bff88c45d41463bdb0b3aa69db Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 9 Mar 2015 15:48:29 +0100 Subject: [PATCH] missing file --- src/pharext/Tempfile.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/pharext/Tempfile.php diff --git a/src/pharext/Tempfile.php b/src/pharext/Tempfile.php new file mode 100644 index 0000000..13ac411 --- /dev/null +++ b/src/pharext/Tempfile.php @@ -0,0 +1,38 @@ +handle = fopen($path, "x"); + } while (!is_resource($this->handle) && $tries++ < 10); + umask($omask); + + if (!is_resource($this->handle)) { + throw new \Exception("Could not create temporary file"); + } + + parent::__construct($path); + } + + function __destruct() { + @unlink($this->getPathname()); + } + + function closeStream() { + fclose($this->handle); + } + + function getStream() { + return $this->handle; + } +} -- 2.30.2