Hey there,
I want to create a new plugin (DefaultServerPage). For that I need a hook, that regenerates the template files (apache for example) after I activate the plugin.
Attached my current version of the plugin.
Thanks!
Hey there,
I want to create a new plugin (DefaultServerPage). For that I need a hook, that regenerates the template files (apache for example) after I activate the plugin.
Attached my current version of the plugin.
Thanks!
Hello ;
What template you want regenerate exactly? I bet 00_master.conf... Anyway, those templates (panel vhost templates are builded while install/update process only). You can of course trigger the installer manually through the plugin but it's more hard.
BTW: in the backend part, you cannot use relative path such as ../templates/apache/00_master.conf" because the backend is not executed from the Gui plugin directory. Backend part is copied into /var/www/engine/Plugins
Edit: i'll show you how to process but before, I ask you to push this work on github and give me an access to your branch. Thanks
Hmm ok thank you. So the absolute path must be hardcoded?
Re;
No, you must use the i-MSCP APi to get GUI base root plugin directory followed by PluginName/templates/apache/00_master.conf
Also, for opening files and so on, please, use the i-MSCP library instead of reinventing the wheel
See the parameters defined in the imscp.conf file
Again, I can help you if you push this works on github.
Thanks! You are now collaborator of the repo. I will commit in the next hour the pathfix
Thx. Send me the link to your repo (via PM)
I'll check it and upload it. The code seem ok now. Only a restricted list of i-MSCP team members is allowed to upload new plugin (using same user).
BTW: In my opinion, someone helped you or your are learning really fast...
Haha I'm a dev, so coding shouldn't be a problem for me. Today I coded the first time in perl, so at first it was a little bit hard to understand the language and imscp-api (also because of the missing documentations :D). But the code of the imscp-project and other plugins helped me out -> your code helped me!
PS: Is there a function to copy an folder? I just found the copyFile()-function...
EDIT: found the rcopy function in the iMSCP::Dir Class...
The plugin and wiki should be ready. Can a dev please test it and upload it to the plugin store (or give me more permissions :D)
https://github.com/Ninos/Serve…tPage/releases/tag/v0.0.1
http://wiki.i-mscp.net/doku.php?id=plugins:serverdefaultpage (atm links to the plugin store are wrong)