Aliro Documentation : AliroOEM

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Aliro OEM - using Aliro as a base for stand alone applications


While Aliro is primarily a CMS framework, sometimes web applications need to be delivered on their own, rather than within a CMS. Or maybe both. Also, taking a stand alone project and turning it into an Aliro OEM project is a step that brings it much closer to being able to be implemented within Aliro.

Ignoring the question of transitioning into an Aliro application, why would you build an Aliro OEM application. Well, the main reason that I started thinking about this was my aTicket Project. It is an open source project descended from eTicket, which has been taken out of open source, and has no roots in the CMS arena. But it needs significant improvement, and many of the things that I wanted are already there in Aliro. Like the ability to get database stats to find out what is slow, or the possibility of easily implementing "Bad Behavior", or a robust session mechanism. And so on.

So what is it all about? Well, an OEM Aliro implementation works with the standard Aliro install process, but there are hooks to incorporate additional setup information needed by the application. Then, the application includes Aliro code pretty much immediately on entry, typically to an index.php file. This is done simply by including aliro.php and instantiating it in OEM mode. The result is that the Aliro controlling logic does not kick in, but all the usual services are available. Given that Aliro operates an autoloading scheme, the application is free to make use of services with a minimum of effort.

Installation


You can see (so long as nobody messes it up!) an example of an Aliro OEM install by looking at http://oem.aliro.org/administrator. Incidentally, the Aliro framework will continue to work if you decide to rename the "administrator" directory to something else.

The mechanism is that if the system is not yet installed, Aliro invokes a class to handle installation. This is done through the factory class aliroInstallerFactory. If the system has been built with a class called oemInstall present (if it is in the usual ../oemclasses directory it only has to be present with the name oemInstall.php to be found) then this will be used. Otherwise, the standard aliroInstall class will be used.

Not much code should be needed in oemInstall, since it can inherit from aliroInstall, which has been designed so that overriding a few methods will alter the behavior of the installer. The methods most likely to be used are extraFormFields (which returns HTML to define extra fields needed for the application install), headerText, licenceText, initialInstructions (all of which return a text string, the meaning of which is obvious from the method names).

You can find the aTicket code with the OEM installer in the aTicket Source Code Repository, part of the Aliro Subversion repository.

Running


To run over Aliro in OEM mode, simply include the file aliro.php as early as possible. Obtain an instance of the aliro class by calling aliro::getInstance(). Then call the startup method on the object. This method has a boolean parameter, but its default value is false, meaning that the Aliro control logic will not be initiated, but all Aliro services will be started up. Or, given that we only work with PHP5, combine it into a single statement that says aliro::getInstance()->startup(); That is it!

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0754 seconds