From: Michael Wallner Date: Mon, 9 Mar 2015 14:48:29 +0000 (+0100) Subject: missing file X-Git-Tag: v2.0.0~6 X-Git-Url: https://git.m6w6.name/?p=pharext%2Fpharext;a=commitdiff_plain;h=02e746254e0800bff88c45d41463bdb0b3aa69db missing file --- 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; + } +}