Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 18th September 2009, 17:47
spr spr is offline
Junior Member
 
Join Date: Aug 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default The basics for doing plugins

Hi

I've decided to write a Plugin for lighttpd.
For that I've looked deep into the Code...
Am I right that Apache2 and other "Webserver-Plugins" will rival due installation?
For me this seems because of all the Plugins are hardcoded in the install.php !?

May be I'm wrong, but for my opinion the installation should only know the Mods and in my "Installation Profile" I've to definde which Plugin is used for each Module...

Please advice.

regards

spr
Reply With Quote
Sponsored Links
  #2  
Old 18th September 2009, 18:44
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,006
Thanks: 826
Thanked 5,377 Times in 4,224 Posts
Default

Hi,

the plugins are not hardcoded in install.php. Every plugin has a function called onInstall() which is called during installation. There you can add code to detect if the the requirements are fullfilled or not e.g. if lighttpd is installed. If this function returns true, the plugin gets enabled, otherwise the plugin is disabled. Not all plugins implement this yet as there are no rival plugins, but the mechanism is implemented already.

The thing that is hardcoded at the moment in install.php are the function calls for the configuration routines of services, which are independant from the plugins. Thats the case as there are no rivaling plugins yet. But there is already a mechanism implemented that checks which software is installed (see installer_base.lib.php -> find_installed_apps() ). So you we just have to change the line(s) in install.php as soon as we have more then one configuration routine for a service:

$inst->configure_apache();

to:

if($conf['apache']['installed']) {
$inst->configure_apache();
}

or in case we add lighttpd:

if($conf['apache']['installed']) {
$inst->configure_apache();
} elseif($conf['lighttpd']['installed']) {
$inst->configure_lighttpd();
} else {
swriteln('No webserver found');
}
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 21st September 2009, 14:49
spr spr is offline
Junior Member
 
Join Date: Aug 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Ok I haven't recognized that there're no concurrent yet.
For my opinion it could make sense to have Install-Profiles which could be hardcoded or done over the Adminpanel !?
Of course there's no need for, but I think it's interessting.
E.g. for checking if the Server still fits the Profile...

regards

spr
Reply With Quote
  #4  
Old 1st October 2009, 15:53
spr spr is offline
Junior Member
 
Join Date: Aug 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi till,

I've burried my head deep into the code for 2 nights
For me it seems definitly that doing a lighty Plugin is much more than writing a plugin!
The Apache part is hardcoded in the Install-Libs and other parts.

However, ISPConfig is great because it fits most of my dependencies
So please let me know your mentions about a lighty plugin, if any...

Btw. my No.1 priority is making ISPConfig more powerful by building in lighty.
But I don't want to reach that at any price! Contribution and woking in harmony is my maxim
Reply With Quote
  #5  
Old 1st October 2009, 16:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,006
Thanks: 826
Thanked 5,377 Times in 4,224 Posts
 
Default

Quote:
The Apache part is hardcoded in the Install-Libs and other parts.
See my comments above about that: its changed in 5 minutes as you have to edit just one file and add just one if statement as all the code to detect the services is already present.

Of course you will have to write configuration routies, but that the case for any service you want to add. The code for the apache part has not to be modified.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for ldap primer beyond the basics chipsafts Server Operation 0 5th December 2008 21:29
Need to learn the down and dirty basics of Linux Ganther Technical 5 6th January 2008 00:00
Wget sources & plugins Tommahawk Feature Requests 1 12th June 2007 04:05
DNS Basics BasicA Server Operation 2 1st October 2006 00:02
Suse 9.3 - Setting up the basics (File and Print Services) creativehook Suggest HOWTO 1 16th October 2005 20:50


All times are GMT +2. The time now is 03:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.