Skip to content

Commit 04f9e6d

Browse files
committed
minor #57801 [Cache] Use tempnam() instead of uniquid() to produce a temporary file (derrabus)
This PR was merged into the 7.2 branch. Discussion ---------- [Cache] Use tempnam() instead of uniquid() to produce a temporary file | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? |no | Deprecations? | no | Issues | Part of #57588 | License | MIT Commits ------- 3465a2b [Cache] Use tempnam() instead of uniquid()
2 parents 450113c + 3465a2b commit 04f9e6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
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)