SWF Activity Module updated for PHP 5.3+

SWF Activity Module updated for PHP 5.3In the world of software development, you always have to be looking ahead. The web server language that Moodle and the SWF Activity Module are written in, PHP, is constantly evolving and being updated. PHP 4 is no longer supported, we’ve been on PHP 5 now for over a year and PHP 6 is just around the corner. How does this affect Moodle and the SWF Activity Module? Read on…

The most significant change

With PHP 5.3, a number of functions have been deprecated, or in other words, there are other newer, better, shinier functions to use in their place and we shouldn’t use the old ones anymore. If we try to use these old functions, PHP 5.3 will send a deprecation warning, telling us that we should change the code. Any code that uses the old functions will probably still work at the moment, but their days are numbered and they’ll vanish in the next version, PHP 6.

Changes to the SWF Activity Module

Adapting the SWF Activity Module to these changes is no problem at all and I’ve updated the module download packages on the project site accordingly. However, Moodle 1.9 and 2.0 still contain a large number of these deprecated functions which can cause problems. So far, I’m happy to say, the new version of the SWF Activity Module seems to function if your server is upgraded to PHP 5.3.

Ongoing issues

However, this does mean that Moodle may be unable to confirm whether or not a grade has been successfully recorded in the grade book. It seems to work in all cases that I’ve tested but there’s no confirmation message because instead, all Moodle sends are the deprecation warnings. Until the Moodle core developer team can fix these issues, there isn’t much more I can do about this. From what I understand, they’re working on replacing the deprecated functions as and when specific errors arise.

What should we do?

The solution recommended by Moodle core developers appears to be “don’t upgrade your server’s PHP version to PHP 5.3”. Fine if you’re running your own dedicated servers but that’s out of your control if you use a shared hosting service. Some other CMS’s are reporting similar issues so we can hope that hosting providers won’t be in any great rush to upgrade anytime soon for fear of annoying the majority of their clients. Mmm… all I can say is upgrade to the latest version of the SWF Activity Module and hope that the Moodle development team can sort out the deprecation issues soon!