Commit b8920794 authored by Rolf Forst's avatar Rolf Forst
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request !18
parents 3951bad6 8d3b303a
......@@ -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]
......
......@@ -4,7 +4,7 @@
Plugin Name: RRZE Cache
Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-cache
Description: Advanced cache management.
Version: 2.7.0
Version: 2.7.1
Author: RRZE-Webteam
Author URI: https://blogs.fau.de/webworking/
License: GNU General Public License v2
......
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