Page 1 of 1

Custom plugin files

Posted: Wed Mar 29, 2006 1:52 pm
by TheArgh
I a writing a plugin that needs to create a number of files for caching purposes as well as storing other data. Is there a standard location for plugins to save files to, or can I decide on my own where to put them? An ideal location would be any of those that have to be writeable for serendipity to function properly, like the serendipity root folder where the initial configuration is written to... My plugin currently creates a custom subfolder in the root serendipity folder (/cache) to store the files.

Posted: Wed Mar 29, 2006 3:20 pm
by falk
Normaly there are no directorys where store thouse files. You must create your own one. cache is good, but can everyone see this directroy if he write the url in the browser, too? I meen it is better to store this files outside the www-root.

Posted: Wed Mar 29, 2006 3:36 pm
by TheArgh
Sure, outside the www-root is better for cache files, but automatically determining a folder location is not practical anymore then - the user has to set a path in the plugin's configuration then, and I would prefer to avoid that... I guess there is no other way unless Serendipity offered file repositories for plugins outside the www-root and in the www-root that can be accessed via serendipity's API.

Posted: Wed Mar 29, 2006 4:12 pm
by garvinhicking
You should use the "archives" or "templates_c" directory. Both are enforced as being writable by serendipity.

It's advised you create your own subdirectory in any of those. Templates_c is my actual favourite.

Best regards,
Garvin

Posted: Wed Mar 29, 2006 4:22 pm
by TheArgh
Hi Garvin,

Thanks for the info, I will use the templates_c folder then and create a subfolder for my plugin there.