cache plugin by Ikuo Obataya
Cache helper class
Last updated on 2008-05-14. Provides Helper.
Compatible with DokuWiki 2006-11-06, 2008-05-05.
This plugin provides a cache mechanism to plugins which needs to store cache files for its own.
| Download | cache.zip(1.2KB) | 2008-05-14 |
|---|
properties
| namespace | Namespace to store cache files | |
|---|---|---|
| mediaDir | Media directory path | |
| mediaFormat | String 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 |
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
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported