summaryrefslogtreecommitdiff
path: root/plugins/cache_starred_images
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-15 16:11:30 +0300
committerAndrew Dolgov <[email protected]>2021-02-15 16:11:30 +0300
commit166f2d46666bb872a1f30a5ab23b113f2f481640 (patch)
treeaba3be014a77a930e067864ce36b72e962100e3a /plugins/cache_starred_images
parent8e79f1717d5270558ffd30c20cc75840b0ecc955 (diff)
diskcache: unify naming
Diffstat (limited to 'plugins/cache_starred_images')
-rwxr-xr-xplugins/cache_starred_images/init.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php
index 9dd4cd49d..9c2d4cb7e 100755
--- a/plugins/cache_starred_images/init.php
+++ b/plugins/cache_starred_images/init.php
@@ -17,18 +17,18 @@ class Cache_Starred_Images extends Plugin {
$this->host = $host;
$this->cache = new DiskCache("starred-images");
- if ($this->cache->makeDir())
- chmod($this->cache->getDir(), 0777);
+ if ($this->cache->make_dir())
+ chmod($this->cache->get_dir(), 0777);
if (!$this->cache->exists(".no-auto-expiry"))
$this->cache->touch(".no-auto-expiry");
- if ($this->cache->isWritable()) {
+ if ($this->cache->is_writable()) {
$host->add_hook($host::HOOK_HOUSE_KEEPING, $this);
$host->add_hook($host::HOOK_ENCLOSURE_ENTRY, $this);
$host->add_hook($host::HOOK_SANITIZE, $this);
} else {
- user_error("Starred cache directory ".$this->cache->getDir()." is not writable.", E_USER_WARNING);
+ user_error("Starred cache directory ".$this->cache->get_dir()." is not writable.", E_USER_WARNING);
}
}
@@ -69,9 +69,9 @@ class Cache_Starred_Images extends Plugin {
/* actual housekeeping */
- Debug::log("expiring " . $this->cache->getDir() . "...");
+ Debug::log("expiring " . $this->cache->get_dir() . "...");
- $files = glob($this->cache->getDir() . "/*.{png,mp4,status}", GLOB_BRACE);
+ $files = glob($this->cache->get_dir() . "/*.{png,mp4,status}", GLOB_BRACE);
$last_article_id = 0;
$article_exists = 1;
@@ -98,7 +98,7 @@ class Cache_Starred_Images extends Plugin {
$local_filename = $article_id . "-" . sha1($enc["content_url"]);
if ($this->cache->exists($local_filename)) {
- $enc["content_url"] = $this->cache->getUrl($local_filename);
+ $enc["content_url"] = $this->cache->get_url($local_filename);
}
return $enc;
@@ -117,7 +117,7 @@ class Cache_Starred_Images extends Plugin {
$local_filename = $article_id . "-" . sha1($src);
if ($this->cache->exists($local_filename)) {
- $entry->setAttribute("src", $this->cache->getUrl($local_filename));
+ $entry->setAttribute("src", $this->cache->get_url($local_filename));
$entry->removeAttribute("srcset");
}
}
@@ -151,7 +151,7 @@ class Cache_Starred_Images extends Plugin {
$status_filename = $article_id . "-" . sha1($site_url) . ".status";
/* housekeeping might run as a separate user, in this case status/media might not be writable */
- if (!$this->cache->isWritable($status_filename)) {
+ if (!$this->cache->is_writable($status_filename)) {
Debug::log("status not writable: $status_filename", Debug::$LOG_VERBOSE);
return false;
}