diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/cache/adapter.php | 1 | ||||
-rw-r--r-- | classes/cache/local.php | 4 | ||||
-rw-r--r-- | classes/diskcache.php | 6 | ||||
-rwxr-xr-x | classes/rssutils.php | 4 |
4 files changed, 5 insertions, 10 deletions
diff --git a/classes/cache/adapter.php b/classes/cache/adapter.php index 88dca21b9..a61e5cb83 100644 --- a/classes/cache/adapter.php +++ b/classes/cache/adapter.php @@ -20,7 +20,6 @@ interface Cache_Adapter { * @return int|false Bytes written or false if an error occurred. */ public function put(string $filename, $data); - public function touch(string $filename): bool; public function get(string $filename): ?string; public function get_full_path(string $filename): string; /** diff --git a/classes/cache/local.php b/classes/cache/local.php index 4461ef4ca..62f33662a 100644 --- a/classes/cache/local.php +++ b/classes/cache/local.php @@ -66,10 +66,6 @@ class Cache_Local implements Cache_Adapter { return file_put_contents($this->get_full_path($filename), $data); } - public function touch(string $filename): bool { - return touch($this->get_full_path($filename)); - } - /** * @return false|null|string false if detection failed, null if the file doesn't exist, string mime content type otherwise */ diff --git a/classes/diskcache.php b/classes/diskcache.php index 69b48688c..80c73682f 100644 --- a/classes/diskcache.php +++ b/classes/diskcache.php @@ -238,8 +238,12 @@ class DiskCache implements Cache_Adapter { return $this->adapter->put($filename, $data); } + /** @deprecated we can't assume cached files are local, and other storages + * might not support this operation (object metadata may be immutable) */ public function touch(string $filename): bool { - return $this->adapter->touch($filename); + user_error("DiskCache: called unsupported method touch() for $filename", E_USER_DEPRECATED); + + return false; } public function get(string $filename): ?string { diff --git a/classes/rssutils.php b/classes/rssutils.php index 2a82a35b0..15efa77bd 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1326,8 +1326,6 @@ class RSSUtils { } else { Debug::log("cache_enclosures: failed with ".UrlHelper::$fetch_last_error_code.": ".UrlHelper::$fetch_last_error); } - } else if (is_writable($local_filename)) { - $cache->touch($local_filename); } } } @@ -1353,8 +1351,6 @@ class RSSUtils { } else { Debug::log("cache_media: failed with ".UrlHelper::$fetch_last_error_code.": ".UrlHelper::$fetch_last_error); } - } else if ($cache->is_writable($local_filename)) { - $cache->touch($local_filename); } } |