Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Executing code at extension activation
Hey.
Where should I place some code I want to execute when my extension is activated/installed?
I've written some code to check if a role and a user exists and to create those if they don't exist yet. At the moment I have the code in my default.php and it executes every time, which is a bit stupid :P
Thanks in advance :)
0
This discussion has been closed.
Comments
if (!array_key_exists('YOUR_SPECIAL_EXTENSION_VARIABLE', $Configuration)) { //do your installation stuff here //and when it's all successfully completed, do the next step: AddConfigurationSetting($Context, 'YOUR_SPECIAL_EXTENSION_VARIABLE', 'SOME_VALUE'); }
i hope mark has more time for vanilla soon. i think extension developers need a few more tools in the vanilla core. cleanup, a global "extension settings" standard (Attachments and JQThickbox handle this perfectly), etc.