Commit 3c5be7fa authored by Rolf Forst's avatar Rolf Forst
Browse files

Update File.php

parent 2feae9d4
......@@ -22,7 +22,7 @@ final class File
* [protected description]
* @var string
*/
protected static $cacheOldDir = WP_CONTENT_DIR . '/advanced-cache-old';
protected static $cacheOldDir = WP_CONTENT_DIR . '/advanced-cache-old';
/**
* [protected description]
......@@ -63,7 +63,7 @@ final class File
{
if (file_exists(self::$cacheDir)) {
return true;
}
}
if (!wp_mkdir_p(self::$cacheDir)) {
do_action('rrze.log.error', __('{plugin}: The directory could not be created.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, 'File::$cacheDir' => self::$cacheDir]);
return false;
......@@ -79,13 +79,13 @@ final class File
{
if (file_exists(self::$cacheOldDir)) {
return true;
}
}
if (!wp_mkdir_p(self::$cacheOldDir)) {
do_action('rrze.log.error', __('{plugin}: The directory could not be created.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, 'File::$cacheOldDir' => self::$cacheOldDir]);
return false;
}
return true;
}
}
/**
* [storeTimeout description]
......@@ -178,7 +178,7 @@ final class File
bin2hex(random_bytes(8));
return self::renameDir($sourceDir, $targetDir);
}
}
/**
* [cacheSignatur description]
......@@ -322,8 +322,6 @@ final class File
// Handle arguments.
if (empty($folder) || !file_exists($folder)) {
return true; // No such file/folder exists.
} elseif (is_file($folder) || is_link($folder)) {
return @unlink($folder); // Delete file/link.
}
// Get all children.
......@@ -341,7 +339,7 @@ final class File
return false; // Abort due to the failure.
}
$i++;
if($maxFiles && $i > $maxFiles) {
if ($maxFiles && $i > $maxFiles) {
return false;
}
}
......@@ -374,7 +372,7 @@ final class File
public static function getCacheOldDir(): string
{
return self::$cacheOldDir;
}
}
/**
* [getTimeoutFile description]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment