HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[Developing] How to make a plugin that edits a file
I am trying to make a plugin that edits a file (more specifically config.php in the /conf folder) and that contains a section in the Dashboard which I'm sure I can copy from whichever plugin that does that. What I need help on, if you don't mind please, is the code to add data to the config.php file AND remove it when the users want to. I want to make a plugin that turns on and off the DEBUG function, but don't know the code to make an addon go into a Vanilla Configuration File.
0
Comments
The
saveToConfig()
will do everything you need: https://github.com/vanillaforums/Garden/blob/master/library/core/functions.general.php#L2978-L2994...combined with
removeFromConfig()
of course: https://github.com/vanillaforums/Garden/blob/master/library/core/functions.general.php#L2840-L2844Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
So an example: saveToConfig($Configuration['Garden'] ['Debug'] = TRUE;)
Would my code be correct?
Almost:
saveToConfig(array('Garden.Debug' => true));
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub