Skip to content

Commit

Permalink
Merge pull request #1884 from greg0ire/patch-2
Browse files Browse the repository at this point in the history
Prevent concurrent writes
  • Loading branch information
sagikazarmark committed Apr 15, 2019
2 parents d9a19b2 + 95f0cd5 commit 40bdb7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cookie/FileCookieJar.php
Expand Up @@ -50,7 +50,7 @@ public function save($filename)
}
}

if (false === file_put_contents($filename, json_encode($json))) {
if (false === file_put_contents($filename, json_encode($json), LOCK_EX)) {
// @codeCoverageIgnoreStart
throw new \RuntimeException("Unable to save file {$filename}");
// @codeCoverageIgnoreEnd
Expand Down

0 comments on commit 40bdb7f

Please sign in to comment.