summaryrefslogtreecommitdiff
path: root/plugins/cache_starred_images/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/cache_starred_images/init.php')
-rwxr-xr-xplugins/cache_starred_images/init.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php
index feec81d62..208eafde9 100755
--- a/plugins/cache_starred_images/init.php
+++ b/plugins/cache_starred_images/init.php
@@ -21,8 +21,8 @@ class Cache_Starred_Images extends Plugin {
function init($host) {
$this->host = $host;
- $this->cache = new DiskCache("starred-images");
- $this->cache_status = new DiskCache("starred-images.status-files");
+ $this->cache = DiskCache::instance("starred-images");
+ $this->cache_status = DiskCache::instance("starred-images.status-files");
if ($this->cache->make_dir())
chmod($this->cache->get_dir(), 0777);
@@ -31,10 +31,10 @@ class Cache_Starred_Images extends Plugin {
chmod($this->cache_status->get_dir(), 0777);
if (!$this->cache->exists(".no-auto-expiry"))
- $this->cache->touch(".no-auto-expiry");
+ $this->cache->put(".no-auto-expiry", "");
if (!$this->cache_status->exists(".no-auto-expiry"))
- $this->cache_status->touch(".no-auto-expiry");
+ $this->cache_status->put(".no-auto-expiry", "");
if ($this->cache->is_writable() && $this->cache_status->is_writable()) {
$host->add_hook($host::HOOK_HOUSE_KEEPING, $this);
@@ -84,10 +84,10 @@ class Cache_Starred_Images extends Plugin {
Debug::log("expiring {$this->cache->get_dir()} and {$this->cache_status->get_dir()}...");
- $files = array_merge(
- glob($this->cache->get_dir() . "/*-*"),
- glob($this->cache_status->get_dir() . "/*.status")
- );
+ $files = [
+ ...(glob($this->cache->get_dir() . "/*-*") ?: []),
+ ...(glob($this->cache_status->get_dir() . "/*.status") ?: []),
+ ];
asort($files);