Optimize your Joomla! 1.5 component installer

Most developers know that a component can have an install.componentname.php, containing a com_install() function with your custom instructions. For example, copying files to different locations or inserting localized sample data. When these instructions fail, you can of course print a message about that. The result however, is that the user sees both your ‘Failed’ message, as well as Joomla!’s ‘Success’ message. Users find this is very confusing.

The solution is actually extemely simple: inside com_install(), you need to return false. This tells the installer that your custom script has failed, and a relevant error message will be displayed. There is an added benefit as well: the installer will perform a rollback, removing all the files in the process.

By the way: I’m blogging live from the Joomlatools Bug Squashing event in Brussels!

Up next

Say hello to LOGman 4.1!

Featuring page views on activity streams

Read more →

TEXTman 3.1 brings advanced analytics and statistics to your Joomla articles

Get in-depth statistics about your Joomla articles with TEXTman 3.1.

Read more →

Continuous integration meets Joomlatools Console

Two new Joomlatools Console plugins to help get you started with automated testing for your own Joomla projects.

Read more →