Skip to content

Commit

Permalink
[6.x] Change File cache store permission to not chmod if not set. (#3…
Browse files Browse the repository at this point in the history
…1593)

* 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 <GrahamCampbell@users.noreply.github.com>
  • Loading branch information
matt-h and GrahamCampbell committed Feb 26, 2020
1 parent 40f1fa1 commit 09101f7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Illuminate/Cache/FileStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FileStore implements Store
/**
* Octal representation of the cache file permissions.
*
* @var int
* @var int|null
*/
protected $filePermission;

Expand All @@ -44,7 +44,7 @@ public function __construct(Filesystem $files, $directory, $filePermission = nul
{
$this->files = $files;
$this->directory = $directory;
$this->filePermission = $filePermission ?? 0775;
$this->filePermission = $filePermission;
}

/**
Expand Down Expand Up @@ -75,7 +75,9 @@ public function put($key, $value, $seconds)
);

if ($result !== false && $result > 0) {
$this->files->chmod($path, $this->filePermission);
if (! is_null($this->filePermission)) {
$this->files->chmod($path, $this->filePermission);
}

return true;
}
Expand Down

0 comments on commit 09101f7

Please sign in to comment.