@@ -34,14 +34,11 @@ public function __construct($namespace = '', $defaultLifetime = 0, $directory =
34
34
$ directory .= '/ ' .$ namespace ;
35
35
}
36
36
if (!file_exists ($ dir = $ directory .'/. ' )) {
37
- @mkdir ($ directory , 0777 , true );
37
+ @mkdir ($ directory , 0755 , true );
38
38
}
39
39
if (false === $ dir = realpath ($ dir ) ?: (file_exists ($ dir ) ? $ dir : false )) {
40
40
throw new InvalidArgumentException (sprintf ('Cache directory does not exist (%s) ' , $ directory ));
41
41
}
42
- if (!is_writable ($ dir .= DIRECTORY_SEPARATOR )) {
43
- throw new InvalidArgumentException (sprintf ('Cache directory is not writable (%s) ' , $ directory ));
44
- }
45
42
// On Windows the whole path is limited to 258 chars
46
43
if ('\\' === DIRECTORY_SEPARATOR && strlen ($ dir ) > 234 ) {
47
44
throw new InvalidArgumentException (sprintf ('Cache directory too long (%s) ' , $ directory ));
@@ -150,7 +147,7 @@ private function getFile($id, $mkdir = false)
150
147
$ dir = $ this ->directory .strtoupper ($ hash [0 ].DIRECTORY_SEPARATOR .$ hash [1 ].DIRECTORY_SEPARATOR );
151
148
152
149
if ($ mkdir && !file_exists ($ dir )) {
153
- @mkdir ($ dir , 0777 , true );
150
+ @mkdir ($ dir , 0755 , true );
154
151
}
155
152
156
153
return $ dir .substr ($ hash , 2 , 20 );
0 commit comments