#1  
Old 13th August 2010, 16:42
jwarnier jwarnier is offline
Member
 
Join Date: Jan 2008
Location: Brussels, Belgium
Posts: 34
Thanks: 5
Thanked 0 Times in 0 Posts
Default Extensions to server.php

We (BeezNest) felt the need for some extension mechanism (plugins) to server.php. To be more specific, being able to add features to it without having to modify server.php itself, like installing web applications automatically on a site.
So we implemented a function to add to server.php to load php files from a server/server.d directory, not unlike the /etc/apache2/conf.d/ directory, which is loaded by Apache and where you can drop "extensions" like aliases to web applications.

Would this be considered as a good addition to ISPconfig or not?
Reply With Quote
Sponsored Links
  #2  
Old 14th August 2010, 15:52
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Unfortunately Till, the main developer, is off for holidays (the first for years ); he'll be back in a week and will be able to answer this question.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 14th August 2010, 17:11
jwarnier jwarnier is offline
Member
 
Join Date: Jan 2008
Location: Brussels, Belgium
Posts: 34
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
Unfortunately Till, the main developer, is off for holidays (the first for years ); he'll be back in a week and will be able to answer this question.
No problem, we just added a require line to another script which does this in our local copy. I think it could be a good addition to ISPconfig, but not being able to merge this for one week is certainly not disturbing.

Thanks for you answer.
Reply With Quote
  #4  
Old 23rd August 2010, 11:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,389 Times in 4,234 Posts
Default

ISPConfig has aleady a mechanism for it, it is named plugins and modules. Why havent you implemented this as module or plugin? I dont think that it is a wise decision to duplicate the functionality.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 23rd August 2010, 12:20
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,389 Times in 4,234 Posts
Default

Here is some short code on how to use the ispconfig module system to execute your code everytime the server.php file is executed without the need of creating a second include system.

1) Add new file with the name my_core_module.inc.php in server/mods-available. The content can be e.g. like this:

Code:
<?php

class my_core_module {

	var $module_name = 'my_core_module';
	var $class_name = 'my_core_module';

	//* This function is called during ispconfig installation to determine
	//  if a symlink shall be created for this plugin.
	function onInstall() {
		global $conf;

		return true;

	}

	/*
        This function is called when the module is loaded
	*/
	function onLoad() {
		global $app;

		//* Do something here
		
		
	}
}

?>
Then add a symlink from server/mods-core/my_core_module.inc.php to server/mods-available/my_core_module.inc.php

Add your custom code below the line "//* Do something here". Such a module should only be used if you do not have added any database tables for the functions that you implemented or these tables are not connected to forms in the interface.

If you use forms in the intrefcae and database tables, then create a normal "non core" module like the server_module or web_module together with events and then add your functionality to a custom plugin that runs event based like all other plugins in the ispconfig server part.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 23rd August 2010 at 12:29.
Reply With Quote
  #6  
Old 23rd August 2010, 12:25
jwarnier jwarnier is offline
Member
 
Join Date: Jan 2008
Location: Brussels, Belgium
Posts: 34
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
ISPConfig has aleady a mechanism for it, it is named plugins and modules. Why havent you implemented this as module or plugin? I dont think that it is a wise decision to duplicate the functionality.
Yes, you are right. We have been stupid in introducing yet another system while there was already one in place.
We will convert ours to a plugin.

We were using this to automatically install a web application to a hosting.
Reply With Quote
  #7  
Old 23rd August 2010, 12:28
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,389 Times in 4,234 Posts
Default

Quote:
Originally Posted by jwarnier View Post
Yes, you are right. We have been stupid in introducing yet another system while there was already one in place.
We will convert ours to a plugin.

We were using this to automatically install a web application to a hosting.
Thanks, that would be great! If you feel that a specific feature is missing in the current plugin / module system to implement your web app installer, please let me know so we can discuss on how to extend the plugin system.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 23rd August 2010, 12:32
jwarnier jwarnier is offline
Member
 
Join Date: Jan 2008
Location: Brussels, Belgium
Posts: 34
Thanks: 5
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by till View Post
Thanks, that would be great! If you feel that a specific feature is missing in the current plugin / module system to implement your web app installer, please let me know so we can discuss on how to extend the plugin system.
We will, no doubt. Thanks for your offering you assistance.

Please note that it is already working using our duplicate "plugin" system for a custom-made installation of Chamilo (an Open Source e-learning platform).
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
frontpage extensions ddouma Installation/Configuration 7 14th July 2008 01:21
PHP extensions in ISPConfig johnwilson1969 Installation/Configuration 4 9th July 2007 18:52
Can not enable Frontpage extensions / mySQL for the site Hans General 2 13th July 2006 13:30
Installing Frontpage Extensions stlshawn Installation/Configuration 6 12th October 2005 12:58


All times are GMT +2. The time now is 06:28.


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