1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Global custom file

Discussion in 'XenForo Development Discussions' started by Helmut2509, Jan 9, 2014.

  1. Helmut2509

    Helmut2509 Member

    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?
  2. Daniel Hood

    Daniel Hood Well-Known Member

    If you're making multiple addons, why not store your addons an extra level deep:


    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.
  3. Helmut2509

    Helmut2509 Member

    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)?
  4. Daniel Hood

    Daniel Hood Well-Known Member

    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.

Share This Page