Custom plugin files

Discussion corner for Developers of Serendipity.
Post Reply
TheArgh
Regular
Posts: 6
Joined: Wed Mar 29, 2006 1:33 pm
Location: Second planet from that big fiery ball
Contact:

Custom plugin files

Post 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.
Anthéa, 5800-pixel wide extravaganza (fr) - and the Almighty Argh!
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Post 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.
TheArgh
Regular
Posts: 6
Joined: Wed Mar 29, 2006 1:33 pm
Location: Second planet from that big fiery ball
Contact:

Post 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.
Anthéa, 5800-pixel wide extravaganza (fr) - and the Almighty Argh!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
TheArgh
Regular
Posts: 6
Joined: Wed Mar 29, 2006 1:33 pm
Location: Second planet from that big fiery ball
Contact:

Post by TheArgh »

Hi Garvin,

Thanks for the info, I will use the templates_c folder then and create a subfolder for my plugin there.
Anthéa, 5800-pixel wide extravaganza (fr) - and the Almighty Argh!
Post Reply