Skip to content

Commit 3465a2b

Browse files
committed
[Cache] Use tempnam() instead of uniquid()
… to produce a temporary file
1 parent 9f2133f commit 3465a2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
4141
private static array $valuesCache = [];
4242

4343
/**
44-
* @param string $file The PHP file were values are cached
44+
* @param string $file The PHP file where values are cached
4545
* @param AdapterInterface $fallbackPool A pool to fallback on when an item is not hit
4646
*/
4747
public function __construct(
@@ -321,7 +321,7 @@ public function warmUp(array $values): array
321321

322322
$dump .= "\n], [\n\n{$dumpedValues}\n]];\n";
323323

324-
$tmpFile = uniqid($this->file, true);
324+
$tmpFile = tempnam(dirname($this->file), basename($this->file));
325325

326326
file_put_contents($tmpFile, $dump);
327327
@chmod($tmpFile, 0666 & ~umask());

0 commit comments

Comments
 (0)