- $temp = sprintf("%s/%s", sys_get_temp_dir(), uniqid($prefix));
- if (!is_dir($temp)) {
- if (!mkdir($temp, 0700, true)) {
- throw new Exception("Could not create tempdir: ".error_get_last()["message"]);
- }
+ $temp = new Tempname($prefix);
+ if (!is_dir($temp) && !mkdir($temp, 0700, true)) {
+ throw new Exception("Could not create tempdir: ".error_get_last()["message"]);