====== cache Plugin ====== ---- plugin ---- description: Cache helper class author : Ikuo Obataya email : I.Obataya@gmail.com type : helper lastupdate : 2008-05-14 compatible : 2008-05-05 depends : conflicts : similar : tags : cache downloadurl: http://symplus.edu-wiki.org/_media/computer/source/cache.zip ---- This plugin provides a cache mechanism to plugins which needs to store cache files for its own. ^Web page|http://symplus.edu-wiki.org/en/cache_plugin|| ^Download|{{http://symplus.edu-wiki.org/_media/computer/source/cache.zip|cache.zip}}(1.2KB)|2008-05-14| =====plugin_cache class===== **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| =====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_email@yahoo.fr|Macfly]] 2008/04/27 00:51// >Thank you, Macfly. I updated the file and uploaded. --- //[[I.Obataya@gmail.com|Ikuo Obataya]] 2008/05/14 17:02//