This website uses cookies to improve your experience and deliver relevant information.

We build solid foundations

Our holistic, strategic approach to design, development and marketing means we help you build a strong, sustainable digital presence

 

on Monday, 24 September 2012

Checking whether your Joomla Component will be compatible with Joomla 3.0

I tweeted a link to the Joomla documentation of potential backwards compatability issues for Joomla 3.0.

There's quite a long list of things there to check, and the easiest way to test may be to download Joomla 3, install and see if anything breaks. Where your extension is quite complex, however, this may not be possible (we all know exhaustive testing just isn't possible). Rather than having to manually check each item on that page, I thought I'd create a script to do some checks for me. Truth be told, I'm rather regretting it now, having had to put each and every item into an array.

However, should it be of use to anyone, the result can be downloaded here.

The tarball contains just one file - J3_Compat.php, released under GNU GPL V2. The rest of this post details how to use it.

You'll need shell level access (I haven't tested it in a browser, but suspect you'll either hit memory_limit or max_execution_time).

Download the PHP file, and extract with tar

tar xvzf J3_Compat.tar.gz

Change directory to the one containing your component (I'm assuming you're doing this on a development machine, but it should also work on a live install)

cd /home/ben/Documents/src/com_mycomponent

Copy the file to the current directory

cp ~/Downloads/J3_Compat.php ./

Now run it

php J3_Compat.php

The script will check every PHP and/or XML file in this directory and it's subdirectories. The output isn't that helpful except to tell you which file, and what it thinks it's found. Where the match involves a class (e.g. JRequest::clean) it's worth checking that the function of variable for that class is actually being used with that class. It may be that the file contains JRequest and contains clean() but clean() has been used with a completely different class. Once you're sure, head over to the Joomla Documentation to see what you need to do/change.

Tidying up afterwards is nice and easy

rm J3_Compat.php



Warnings

The code comes with no warranty what-so-ever, I'm pretty certain it won't trash your machine but can't accept responsibility if it does. I also can't accept any responsibility if it slows your machine down whilst running, it's perhaps not as efficient as it could be but it works well. Any bugs will probably be answered with "It works on my machine!" but please do send them through so I can fix them.

 

Update

Fixed the broken links to the file, sorry! Had uploaded the archives in a different format and forgot to update the links when I changed it!

Also, it's occurred to me that whilst this should be obvious, I should say: Just because this script doesn't find anything doesn't guarantee that your extension will work with Joomla 3.0!

 

We're specialists in Content Management Systems Want to work with the experts?

Virya Group provides a range of solutions to your technology needs