From: John G. <gr...@ag...> - 2007-10-11 12:32:25
|
Jamie Cameron wrote: > On 10/Oct/2007 15:43 John Gray wrote .. > >> I just started using virtualmin, for the most part I really like it. I >> particularly like the plugin support. I was able to write a plugin for >> a few misc things we need when a virtual server is created quite easily. >> (I'd post it, but I doubt its useful to anybody but me). >> > > Hi John, > > I'm glad to hear that someone else has used the plugin API successfully .. > hopefully it wasn't too baroque. I write a few plugins myself, but the > real test of an API is how easy it is for others to use :) > > Hi Jamie, I can give you a little feedback on the ups and downs of a newbie creating his/her first plugin. First off having a template plugin would be very nice. I ended copying a very simple plugin, then replacing the guts with my own. The next hurdle was getting it registered. I ended up running the create_domain.pl through the perl debugger and noticed it was getting the plugins form some config option that did not have my plugin listed. I'm not sure what I missed when adding it through the web interface, but I ended up adding it to the config by hand. The last thing, would be hints on the debugging. I eventually figured out figure how to get into my plugin quickly by running the perl debugger on create_domain.pl or delete_domain.pl and jumping to just the right lines (maybe this is short coming on my perl debugger knowledge, I can't seem to set a break point in another file). It was also very helpful to include Data::Dumper in my lib functions file, and dump all the args to a file when my apis get called. It wasn't very clear all what data I was going to receive. In the end, it works quite nicely. I'm very happy with how much virtualmin is doing for me, and that its allowing me to extended it to handle my servers irregularities easily. John -- John Gray gr...@ag... AgoraNet, Inc. (302) 224-2475 314 E. Main Street, Suite 1 (302) 224-2552 (fax) Newark, De 19711 http://www.agora-net.com |