Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 2, 2020
1 parent 5fa0310 commit cf66e2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Cache/FileCacheStorage.php
Expand Up @@ -56,6 +56,9 @@ public function load(string $key, string $variableKey)
*/
public function save(string $key, string $variableKey, $data): void
{
$path = $this->getFilePath($key);
$this->makeDir(dirname($path));

$tmpPath = sprintf('%s/%s.tmp', $this->directory, Random::generate());
$tmpSuccess = @file_put_contents(
$tmpPath,
Expand All @@ -68,8 +71,6 @@ public function save(string $key, string $variableKey, $data): void
throw new \InvalidArgumentException(sprintf('Could not write data to cache file %s.', $tmpPath));
}

$path = $this->getFilePath($key);
$this->makeDir(dirname($path));
@rename($tmpPath, $path);
}

Expand Down

0 comments on commit cf66e2d

Please sign in to comment.