Storage of Plugin Data

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Storage of Plugin Data

Post by cmb » Wed Nov 14, 2012 7:23 pm

Hello Community,

in http://www.cmsimpleforum.com/viewtopic.php?f=29&t=5260 was a rather lengthy discussion about changing the folder layout of CMSimple_XH 1.6. Unfortunately the discussion was without a final agreement yet. Nonetheless I like to suggest the following guidelines for plugin developers regarding where to store the plugin data.
  • cross-language/subsite data should be stored relative to $pth[folder][base]
  • language/subsite-specific data should be stored relative to $pth[folder][content]
$pth[folder][base] points to the CMSimple installation folder (aka. root folder); $pth[folder][content] points to the folder, where the content of the current language(subsite) is stored.

To cater for special demands of the users, the exact storage path should be made configurable (relative to the respective $pth[folder][...]).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1660
Joined: Wed Dec 17, 2008 5:08 pm

Re: Storage of Plugin Data

Post by svasti » Wed Nov 14, 2012 7:36 pm

That's actually what I did to Teaser_XH. I think it's a good guideline.

svasti

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Storage of Plugin Data

Post by cmb » Wed Nov 14, 2012 9:52 pm

Hi svasti,

I just had a look at Teaser_XH, and it's even more flexible than the suggested guideline: the user can configure, if he likes to store relative to $pth[folder][base] or $pth[folder][content]. IMO that's a noteworthy optional (?) addition to my suggested guideline.

But again I want to stress the use of $pth[folder][base] and particularly $pth[folder][content]. The latter is set in cmsimple/cms.php:

Code: Select all

$pth['folder']['content'] = './content/';
But of course an advanced user (webmaster, webdesigner) could change this line, e.g.:

Code: Select all

$pth['folder']['content'] = $pth['folder']['base'] . 'plugindata/';
(for a "simple" installation, which does neither require additional languages nor subsites) or

Code: Select all

$pth['folder']['content'] = $pth['folder']['base'] . 'plugindata_' . $sl . '/';
(for or multi-lingual website)

This flexibility couldn't be achived, if the plugin stores relative to './'.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply