[pmwiki-users] Volatile file location?

Joachim Durchholz jo at durchholz.org
Wed Apr 26 05:32:59 CDT 2006


Allister Jenks schrieb:
> On 4/26/06, Joachim Durchholz <jo at durchholz.org> wrote:
>> Allister Jenks schrieb:
>>> Hi,
>>>
>>> I'm writing a recipe which may create files that will be used across
>>> multiple calls but which are essentially time limited.
>>>
>>> Where is the correct directory to write those files in the PmWiki
>>> structure?  I currently have them writing to the cookbook directory
>>> but instinct tells me this is wrong.
>> Sounds like the session directory to me.
> 
> Ummm.  Not sure what you mean by that?  I don't see any directory with
> that name in my installation.

Sorry for being overly terse.

I meant the directory where PHP stores its session files. I think it's 
listed in the phpinfo() output for human consumption, and available via 
ini_get() for scripts.

> Perhaps I was not clear.  When rendering some markup with a new
> directive, I retrieve some information and store it in a file. 
> However next time I check to see if the file is there and use that
> rather than retrieving again.  It's basically caching.  I have, for
> now, used the pub/ directory as it seemed to me that the cookbook
> directory should be static files only.

You could create something like pub/<recipename>/cache.
(Makes installation a lot harder though. Sticking with the session 
directory is simpler.)


Whatever you do, make sure that you clean the cache from time to time.
A customer of mine had a script that generated graphics, and cached it 
in a directory. The cache was never cleared, so after two years, she hit 
the disk quota and didn't understand why so many of her scripts had 
stopped working (it wasn't initially obvious that it had hit just those 
scripts that tried to create another file).

Regards,
Jo




More information about the pmwiki-users mailing list