目录

cache Plugin

兼容的版本 Dokuwiki

2008-05-05

plugin Cache helper class

最后更新于
2008-05-14
提供
Helper

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

标签 cache

被依赖 autoviewer, chart, slideshow, sviewer

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

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