Skip to content

Commit 09101f7

Browse files
[6.x] Change File cache store permission to not chmod if not set. (#31593)
* Change cache filesystem permission so if the config is not set it does not issue a chmod call. This reverts some of the behavior in 61b5aa1 From pull request #31579 * Update FileStore.php Co-authored-by: Graham Campbell <[email protected]>
1 parent 40f1fa1 commit 09101f7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Illuminate/Cache/FileStore.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class FileStore implements Store
2828
/**
2929
* Octal representation of the cache file permissions.
3030
*
31-
* @var int
31+
* @var int|null
3232
*/
3333
protected $filePermission;
3434

@@ -44,7 +44,7 @@ public function __construct(Filesystem $files, $directory, $filePermission = nul
4444
{
4545
$this->files = $files;
4646
$this->directory = $directory;
47-
$this->filePermission = $filePermission ?? 0775;
47+
$this->filePermission = $filePermission;
4848
}
4949

5050
/**
@@ -75,7 +75,9 @@ public function put($key, $value, $seconds)
7575
);
7676

7777
if ($result !== false && $result > 0) {
78-
$this->files->chmod($path, $this->filePermission);
78+
if (! is_null($this->filePermission)) {
79+
$this->files->chmod($path, $this->filePermission);
80+
}
7981

8082
return true;
8183
}

0 commit comments

Comments
 (0)