DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:cache

cache Plugin

Compatible with DokuWiki

2006-11-06, 2008-05-05

plugin Cache helper class

Last updated on
2008-05-14
Provides
Helper

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with cache

This plugin provides a cache mechanism to plugins which needs to store cache files for its own.

Web pagehttp://symplus.edu-wiki.org/en/cache_plugin
Downloadcache.zip(1.2KB)2008-05-14

plugin_cache class

properties

namespace Namespace to store cache files
mediaDir Media directory path
mediaFormatString format to make a cache path
linkFormat String format to make a link (DokuWiki ID)
prefix Prefix for cache files
extension Extension for cache files

functions

GetMediaPath($id)Get a media path for cache ID
GetMediaLink($id)Get a link URL to fetch a cache
GetMediaText($id)Get a text of cache file
CheckDir()Check and make a cache directory called in constructor
ClearCache()Clear all cache files in a namespace
RemoveDir()Clear and remove cache directory

History

  • 2008.5.14
    • Bug fix for incorrect media directory path creation.
  • 2008.4.18
    • Bug fix for some incorrect media links with ‘:’
  • 2008.3.22
    • First version was uploaded.

Discussion

Thanks for your work. I still have a problem with URL and path with the 2008.4.18 release. I'm using $conf['useslash'] = 0 and file are create in data/media:namespace:filename and not in data/media/namespace/filename. I made the following change :

--- plugin_cache.php.orig    2008-04-18 20:19:54.000000000 +0200
+++ plugin_cache.php        2008-04-27 00:48:59.000000000 +0200
@@ -25,8 +25,8 @@
       $this->prefix = $_prefix.'_';
     }
     $delimiter = ($conf['useslash'])?'/':':';
-    $this->mediaDir    = $conf['mediadir'].$delimiter.$this->namespace;
-    $this->mediaFormat = $this->mediaDir.$delimiter.$this->prefix.'%s.'.$this->extension;
+    $this->mediaDir    = $conf['mediadir']."/".$this->namespace;
+    $this->mediaFormat = $this->mediaDir."/".$this->prefix.'%s.'.$this->extension;
     $this->linkFormat  = $this->namespace.$delimiter.$this->prefix.'%s.'.$this->extension;
 
     $this->CheckDir();

Macfly 2008/04/27 00:51

Thank you, Macfly. I updated the file and uploaded.

Ikuo Obataya 2008/05/14 17:02

plugin/cache.txt · Last modified: 2016-01-24 19:12 by Aleksandr