From a50bab5445ec4605d4904ae002a525fbd18e9a28 Mon Sep 17 00:00:00 2001 From: Ben Manu Date: Thu, 6 Nov 2014 08:43:38 +1300 Subject: [PATCH] Add umask when saving state to the file system to prevent permission denied error --- code/TestSessionEnvironment.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/TestSessionEnvironment.php b/code/TestSessionEnvironment.php index 449944b..257d304 100644 --- a/code/TestSessionEnvironment.php +++ b/code/TestSessionEnvironment.php @@ -299,7 +299,9 @@ class TestSessionEnvironment extends Object { } else { $content = json_encode($state); } + $old = umask(0); file_put_contents($this->getFilePath(), $content, LOCK_EX); + umask($old); } public function loadFromFile() {