Skip to content

Commit 01db8d9

Browse files
authored
Merge pull request #616 from Geolim4/master
Preventive hotfix for #614
2 parents 9c333d7 + a90f38a commit 01db8d9

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ protected function getFilePath($keyword, $skip = false): string
162162
/**
163163
* Skip Create Sub Folders;
164164
*/
165-
if (!$skip && @!\mkdir($path, $this->getDefaultChmod(), true) && !\is_dir($path)) {
166-
throw new PhpfastcacheIOException('PLEASE CHMOD ' . $path . ' - ' . $this->getDefaultChmod() . ' OR ANY WRITABLE PERMISSION!');
165+
if (!$skip && !\is_dir($path) && @!\mkdir($path, $this->getDefaultChmod(), true) && !\is_dir($path)) {
166+
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 !');
167167
}
168168

169169
return $path . '/' . $filename . '.' . $this->getConfig()->getCacheFileExtension();

lib/Phpfastcache/Drivers/Files/Driver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ protected function driverDelete(CacheItemInterface $item): bool
127127
if ($item instanceof Item) {
128128
$file_path = $this->getFilePath($item->getKey(), true);
129129
if (\file_exists($file_path) && @\unlink($file_path)) {
130+
\clearstatcache(true, $file_path);
130131
$dir = \dirname($file_path);
131132
if (!(new \FilesystemIterator($dir))->valid()) {
132133
\rmdir($dir);

lib/Phpfastcache/Util/Directory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public static function rrmdir(string $source, bool $removeOnlyChildren = false):
8686
}
8787

8888
if (\is_file($source) || \is_link($source)) {
89+
\clearstatcache(true, $source);
8990
return \unlink($source);
9091
}
9192

0 commit comments

Comments
 (0)