Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Development

Mambo Manual is part of the documentation project for the Mambo open source content management system

Toggle Sidebar

Completing the Compatible Extension


Putting it all together...
This article is the final part of the four-part series of articles about developing extensions with compatibility in mind.

Let's put it all together and see how it works. You have your class defined.
Now you need to put it in a file by itself. Give it a meaningful name related to the system it's running on like compat.mambo.php.
Then create some logic to load your script based on the system version.

Here's an example:

$path = 'somePath';

$version = someCoreClass->getVersionName();
switch ($version) {
	case 'jimbo':
		require_once("$path/compat.jimbo.php");
		break;
	case 'joebo':
		require_once("$path/compat.joebo.php");
		break;
	case 'mambo':
	default:
		require_once("$path/compat.mambo.php");
		break;
}

Conclusion

You now have a compatible system that will be easy to upgrade and maintain. Whenever something changes, just edit the appropriate compat.xxx.php script, upload it to your system, and you're ready to go.

Submitted by: Al Warren 17:15, 25 January 2007 (CST)

Toggle Sidebar
Space Navigation
Added by Lynne Pope on 30 Dec, 2007 03:19, last edited by Lynne Pope on 19 Sep, 2008 16:35

Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license