23 public static function generateTemporalFile(
string $prefix,
string $suffix =
'.tmp',
int $timeToLive = 3): self
25 $tempDir = \CTempFile::getDirectoryName($timeToLive, array($prefix, \uniqid($prefix,
true)));
26 Path::checkCreatePath($tempDir.
'/');
28 $hash = \str_pad(\dechex(\crc32($tempDir)), 8,
'0', STR_PAD_LEFT);
29 $fileName = \uniqid($hash.
'_',
false). $suffix;
31 return new static($tempDir. $fileName);