Skip to content

Commit 834b50f

Browse files
committed
remove is_writable check on filesystem cache
1 parent 73a7169 commit 834b50f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,11 @@ public function __construct($namespace = '', $defaultLifetime = 0, $directory =
3434
$directory .= '/'.$namespace;
3535
}
3636
if (!file_exists($dir = $directory.'/.')) {
37-
@mkdir($directory, 0777, true);
37+
@mkdir($directory, 0755, true);
3838
}
3939
if (false === $dir = realpath($dir) ?: (file_exists($dir) ? $dir : false)) {
4040
throw new InvalidArgumentException(sprintf('Cache directory does not exist (%s)', $directory));
4141
}
42-
if (!is_writable($dir .= DIRECTORY_SEPARATOR)) {
43-
throw new InvalidArgumentException(sprintf('Cache directory is not writable (%s)', $directory));
44-
}
4542
// On Windows the whole path is limited to 258 chars
4643
if ('\\' === DIRECTORY_SEPARATOR && strlen($dir) > 234) {
4744
throw new InvalidArgumentException(sprintf('Cache directory too long (%s)', $directory));
@@ -150,7 +147,7 @@ private function getFile($id, $mkdir = false)
150147
$dir = $this->directory.strtoupper($hash[0].DIRECTORY_SEPARATOR.$hash[1].DIRECTORY_SEPARATOR);
151148

152149
if ($mkdir && !file_exists($dir)) {
153-
@mkdir($dir, 0777, true);
150+
@mkdir($dir, 0755, true);
154151
}
155152

156153
return $dir.substr($hash, 2, 20);

0 commit comments

Comments
 (0)