download progress, cleanups
[pharext/pharext] / src / pharext / Tempfile.php
index d31f45772d75f90057898edfc314e94c8524e53c..c890cd92262b1ec163bb6d9dc19d5959343afa1e 100644 (file)
@@ -8,11 +8,12 @@ class Tempfile extends \SplFileInfo
        
        function __construct($prefix) {
                $tries = 0;
-               $template = sys_get_temp_dir()."/$prefix.";
+               /* PharData needs a dot in the filename, sure */
+               $temp = sys_get_temp_dir() . "/";
                
                $omask = umask(077);
                do {
-                       $path = $template.uniqid();
+                       $path = $temp.uniqid($prefix).".tmp";
                        $this->handle = fopen($path, "x");
                } while (!is_resource($this->handle) && $tries++ < 10);
                umask($omask);