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.
2 parents 0deac55 + 9fc5cab commit ef5965cCopy full SHA for ef5965c
src/AssetManager/Cache/FilePathCache.php
@@ -87,7 +87,10 @@ public function set($key, $value)
87
throw new \RuntimeException('Unable to write file ' . $this->cachedFile());
88
}
89
90
- file_put_contents($this->cachedFile(), $value);
+ // Use "rename" to achieve atomic writes
91
+ $tmpFilePath = $cacheDir . '/' . uniqid('AssetManagerFilePathCache');
92
+ file_put_contents($tmpFilePath, $value);
93
+ rename($tmpFilePath, $this->cachedFile());
94
95
96
/**
0 commit comments