Do these screenshots look like Joomla! to you? Well, they are! They’re not from the Joomla! CMS though, they’re from a Joomla! application, based on the Joomla! Framework, and running in a terminal window. Betcha you didn’t know that was possible!

Joomla! without Joomla!

JApplications work on a completely different level than extensions. They’re more or less standalone web application, based on the Joomla! Framework, in the same way a Ruby on Rails application is a standalone web app based on the RoR framework. When you install Joomla! CMS on your site, you’re actually installing four applications, along with the framework.

  • JSite (the front-end of your site)
  • JAdministrator (the back end)
  • JInstallation (the installer, which you are supposed to delete when you’ve finished installing J!)
  • JXMLRPC (for the XML-RPC protocol, but that’s a subject for a different post).

As far as I know, no third party Joomla! applications available at the moment, except for one: RokBridge, a bridge for J! and PhpBB3, which Johan built for RocketWerx. It is possible to create applications that are truly standalone as well. You could for example create a CRM web app, that uses the framework, but that is totally independant of the CMS. Instead of starting from scratch, you could use some of the features of the framework, such as authentication, plugin support, MVC, … to build you own solution. And, as you can see from the screenshots, you can even use it outside of the web or the browser, to make a command line application, that runs in a terminal.

Unit Testing

Writing unit tests for a Joomla! extension, requires that you can mimick the environment in which the extension runs. It also requires that you can run the tests from the command line, so you can execute them from inside an IDE, from a Phing or Ant script, etc. So that’s how I got the idea to write a Joomla! application that has the single purpose of recreating a Joomla! environment in which the tests run. The actual tests are then passed on to PHPUnit. It only took me a couple of hours to build. All I did was basically copy the JSite application, remove everything I didn’t need, and add PHPUnit to the mix. Easy! The biggest task now is of course to write more tests, so when we show Nooku to the world, we know it’s working.

  • http://corywebbmedia.com corywebb

    Thanks for sharing, Mathias. When you say you copied the jSite application, what exactly did you copy?

  • http://mathiasverraes.com Mathias Verraes

    The JSite class is in /includes/application.php.
    If you look at index.php and includes/application.php, you can easily follow the flow the code and keep what you need for your own application.

  • http://corywebbmedia.com corywebb

    Thanks! I think I understand now.

  • h4t3

    this is really interesting, where can i find documentation or references?

  • http://johan.janssens.me Johan Janssens

    More information can be found in one of my other blog posts, here is the link : http://blog.joomlatools.org/2008/04/building-bridges-using-joomla.html

    If you have further questions don’t hesitate to post them on our development forums : http://forum.joomlatools.org/viewforum.php?f=26

  • http://www.webamoeba.co.uk webamoeba

    Interesting… I’ve been trying to use the unit testing stuff in the Joomla! SVN code repository, and although it works it feels very hacky and I seem to have to do an awful lot of leg work in the setup method of all the test classes. Would be very interetsed to see the cod for the application you built to incorporate PHPUnit, any chance of it being published somewhere?

  • http://mathiasverraes.com Mathias Verraes

    The problem with the J1.5 framework is that it is still very tightly coupled (even though huge progress was made there). Unit testing works best when you can test individual classes, without having to load 30 others to get it to work.
    Creating a joomla application to wrap the unit tests is a workaround for this problem. It works just like the site or administrator applications, but it only loads the essentials. Furthermore it captures the command line and sends it along to phpunit.

  • http://mathiasverraes.com Mathias Verraes

    The problem with the J1.5 framework is that it is still very tightly coupled (even though huge progress was made there). Unit testing works best when you can test individual classes, without having to load 30 others to get it to work.
    Creating a joomla application to wrap the unit tests is a workaround for this problem. It works just like the site or administrator applications, but it only loads the essentials. Furthermore it captures the command line and sends it along to phpunit.

  • http://www.webamoeba.co.uk webamoeba

    Very true, loose coupling and high cohesion all round I say!!

    Hopfully the SVN unit testing stuff will develop into somthing more like the Drupal mechanism that allows unit tetsing to occur. That is to say, a graphical user interface that integrates seamlessly with Joomla!. Hmmm, guess I’ll be waiting some time for that :p

    ps. I meant to say code in the last comment, not cod. Although Cod ‘n’ Chips are always nice :)

  • http://www.webamoeba.co.uk webamoeba

    Very true, loose coupling and high cohesion all round I say!!

    Hopfully the SVN unit testing stuff will develop into somthing more like the Drupal mechanism that allows unit tetsing to occur. That is to say, a graphical user interface that integrates seamlessly with Joomla!. Hmmm, guess I’ll be waiting some time for that :p

    ps. I meant to say code in the last comment, not cod. Although Cod ‘n’ Chips are always nice :)

  • http://www.talentsfromindia.com/joomla-cms-developer.html joomla opensource

    themes use a set of CSS classes to implement a set of visuals and it is up to the application to use those classes. Rails does not (and cannot) have a theme of its own.

  • http://www.hdvideoshare.net/ video sharing script

    Your blog is pretty and impressed me a lot.. Joomla extension they are really great well done job