Skip to content

Commit 6af916f

Browse files
committed
Preventive hotfix for #614
1 parent f6eee21 commit 6af916f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/phpFastCache/Core/Pool/IO/IOHelperTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ protected function getFilePath($keyword, $skip = false)
153153
*/
154154
if (!$skip) {
155155
if (!file_exists($path)) {
156-
if (@!mkdir($path, $this->getDefaultChmod(), true)) {
157-
throw new phpFastCacheIOException('PLEASE CHMOD ' . $path . ' - ' . $this->getDefaultChmod() . ' OR ANY WRITABLE PERMISSION!');
156+
if (@!mkdir($path, $this->getDefaultChmod(), true) && !is_dir($path)) {
157+
throw new phpFastCacheIOException('Path "' . $path . '" is not writable, please set a chmod 0777 or any writable permission and make sure to make use of an absolute path !');
158158
}
159159
}
160160
}

src/phpFastCache/Drivers/Files/Driver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ protected function driverDelete(CacheItemInterface $item)
118118
if ($item instanceof Item) {
119119
$file_path = $this->getFilePath($item->getKey(), true);
120120
if (file_exists($file_path) && @unlink($file_path)) {
121+
clearstatcache(true, $file_path);
121122
$dir = dirname($file_path);
122123
if (!(new \FilesystemIterator($dir))->valid()) {
123124
rmdir($dir);

0 commit comments

Comments
 (0)