Global custom file

I have a file with configuration settings which is used by at least two different addOns.
(it woud be rather cumbersome to have the same config file in each addOn).
So where is the best place to store this config file?
Is there any risk that the file disappears after a xenforo update, if it is stored in the root directory or in the library folder?
 
If you're making multiple addons, why not store your addons an extra level deep:

/library/addon1/
becomes
/library/helmut/addon1/

Then you could store shared files in /library/helmut plus when people install groups of your addons, they'll all be in a mutual folder so they can find the ones by you quicker.
 
thanks Daniel, that is a possible solution.
But is there any reason why the config file shouldn't be stored in a global folder (root or library folder)?
 
There isn't a reason why it can't be.

I honestly feel like it shouldn't be though for a couple of reasons:
  • Depending on the name of the file, someone may forget why it's there and delete it.
  • When some people upgrade, they do delete files instead of just overwriting them and yours may get deleted.
  • Plus, it's also recommended to avoid clashing. There are several people with multiple add ons if they all put a file in the root folder or library folder, there's absolutely be issues. Plus as XenForo is the primary product, they should reserve the right to those folders. If they decide to add a file with the same name in the next version, you'd be out of luck.
 
Back
Top Bottom