The Nooku Framework serves as a replacement of the Joomla! 1.5 Framework and improves development a lot: It's main focus is to "do more, write less" and acts as a Rapid Development Environment within Joomla!. In this tutorial we will discuss the basics of setting up the Nooku Framework on a Linux environment.
Getting the Nooku sources
The Nooku code is maintained through Subversion (SVN) and can be obtained by checking out a snapshot from the SVN server:
svn checkout http://svn2.assembla.com/svn/nooku-framework/
The command above will create a full copy from the SVN repository, which contains various branches, the main trunk and also some stable releases. At the time of writing, there were no ready-to-go packages included in the SVN repository. But these packages can easily be created through Phing.
pear channel-discover pear.phing.info
pear install --alldeps phing/phing
On our system, the VersionControl_SVN package was also required (but was only available as an alpha-version):
pear install VersionControl_SVN-alpha
Using phing to build packages
The Phing scripts used to build Nooku packages, are not included in the main Nooku repository, but in a separate repository called nooku-tools. You'll need to checkout that repository as well:
svn checkout http://svn2.assembla.com/svn/nooku-tools/
After that's done, you can browse to the trunk/phing/build folder and run the phing script:
This will create package-files that can easily be installed through the Joomla! Administrator. Most likely you are building just one package: Koowa, which is the codename for the Nooku Framework.
Installing the Nooku Framework in Joomla!
The package-files created through phing can be installed through the Joomla! Installer in the Joomla! backend. The Koowa package actually installs a couple of extensions: The Koowa System Plugin (which makes sure the Nooku Framework is properly loaded), the Koowa libraries, a default Nooku component and a default Nooku module. The last two contain classes, that can serve as a default parent for your own Joomla! extension-classes.
After installing the Koowa extension, you can make sure that the Koowa System Plugin is published. It should already be activated during the installation.
Nooku makes use of the MySQLi interface of PHP, which again makes use of the new capabilities introduced by MySQL5. This requires you to modify the Joomla! configuration. By opening up the configuration.php file you can change mysql into mysqli:
var $dbtype = 'mysqli';
On top of PHP, many hosting providers install the Suhosin security patches which tightens the security of PHP-scripts. This is a good thing, but sometimes PHP-scripts conflict with Suhosin settings. With Nooku this is the case. By adding the following rule to the PHP configuration-file php.ini, things should work fine:
suhosin.executor.include.whitelist = tmpl://, file://
Once this is done, you should be ready to go and develop your own Nooku extension. More tutorials will be available soon on Nooku development.