Commit 27f33aa5 authored by Rolf Forst's avatar Rolf Forst
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request !25
parents cfe96196 499c5ea9
......@@ -628,7 +628,9 @@ function getCache()
exit;
} else {
// Stale: Remove the cache file.
unlink($cacheFile);
if (@unlink($cacheFile)) {
clearstatcache();
}
}
}
}
......
......@@ -49,7 +49,11 @@ final class File
*/
public static function removeSymlink(): bool
{
return @unlink(self::$cacheFile);
if (@unlink(self::$cacheFile)) {
clearstatcache();
return true;
}
return false;
}
/**
......@@ -332,6 +336,8 @@ final class File
$action = ($fileinfo->isDir() ? 'rmdir' : 'unlink');
if (!@$action($fileinfo->getRealPath())) {
return false; // Abort due to the failure.
} else {
clearstatcache();
}
$i++;
if ($maxFiles && $i > $maxFiles) {
......
......@@ -311,7 +311,9 @@ class Settings
if (!empty($ipAddresses) && $skipOnIp = json_encode($ipAddresses)) {
UFile::write($filename, $skipOnIp);
} else {
@unlink($filename);
if (@unlink($filename)) {
clearstatcache();
}
}
$enableCache = $this->enableCache();
......
......@@ -7,7 +7,7 @@ defined('ABSPATH') || exit;
final class File
{
/**
* write
* Write data into a file.
* @param string $file
* @param string $data
* @return boolean
......@@ -24,7 +24,7 @@ final class File
}
/**
* chmod
* Change the access permissions of a file.
* @param string $file
* @return boolean
*/
......
......@@ -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.9.2
Version: 2.9.3
Author: RRZE-Webteam
Author URI: https://blogs.fau.de/webworking/
License: GNU General Public License v2
......@@ -109,7 +109,9 @@ function activation()
*/
function deactivation()
{
@unlink(WP_CONTENT_DIR . '/advanced-cache.php');
if (@unlink(WP_CONTENT_DIR . '/advanced-cache.php')) {
clearstatcache();
}
delete_site_option(Options::getSiteOptionName());
}
......
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