[pmwiki-users] data from wiki page rather than file

Patrick R. Michaud pmichaud at pobox.com
Wed May 4 20:37:39 CDT 2005


On Wed, May 04, 2005 at 05:55:01PM -0700, Carl Boe wrote:
> In general, is there an accepted way to have markup for a page depend upon 
> and manipulate raw content in another page, not just include it?  Could 
> this be done with knowledge of modification times, so that a cached page 
> does not have to regenerate if its dependencies are older than its last 
> modification date?

Yes, this can happen -- in general one uses the ReadPage() function
to get at the wiki page data (or RetrieveAuthFunction() if authorization
issues need to be handled).  There are several recipes and scripts
that do this already.  The XLPage routines (in pmwiki.php) load
translation strings from other wiki pages, the BlockList recipe uses
a wiki page to maintain a list of forbidden words and addresses, and 
the URL approvals code (scripts/urlapprove.php) uses a wiki page
to maintain a list of valid web addresses.

So, yes, it's doable.

Caching is a slightly different issue -- generally someone needs a place
to store cache files.  I'm thinking it might be worthwhile for us to
designate a standard directory where scripts can store cached files
of various types.  I'm thinking it should be either cache.d/ or
wiki.d/cache.d/ , with the latter being slightly more preferable
because an admin then only has to protect one directory (wiki.d/) 
and not two.  Any thoughts from others about a cache directory...?

Pm



More information about the pmwiki-users mailing list