We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 180f89e commit 01c0c64Copy full SHA for 01c0c64
src/RobotLoader/RobotLoader.php
@@ -438,10 +438,9 @@ private function loadCache(): void
438
private function saveCache(): void
439
{
440
$file = $this->getCacheFile();
441
- $tempFile = $file . uniqid('', true) . '.tmp';
442
$code = "<?php\nreturn " . var_export([$this->classes, $this->missing], true) . ";\n";
443
- if (file_put_contents($tempFile, $code) !== strlen($code) || !rename($tempFile, $file)) {
444
- @unlink($tempFile); // @ - file may not exist
+ if (file_put_contents("$file.tmp", $code) !== strlen($code) || !rename("$file.tmp", $file)) {
+ @unlink("$file.tmp"); // @ - file may not exist
445
throw new \RuntimeException("Unable to create '$file'.");
446
}
447
if (function_exists('opcache_invalidate')) {
0 commit comments