Dependencies of Modules on PHP/MySQL

Dependencies of Modules on PHP/MySQL

Lloyd Stock發表於
Number of replies: 4
Hi,
I've a few questions which have to do with the ability of a particular PHP version or MySQL version to break my moodle module. This goes without saying that the Moodle version itself may break my module.

1. When developing a Moodle module what should be my approach to developing such that I avoid becoming dependant on PHP and MySQL?

2. Or am I being unnecessarily cautious. Is Moodle designed in such a way that as a developer of Moodle modules, all I have to worry about is the Moodle version. The next Moodle version will take care of PHP and MySQL changes etc. and ensure that my module functions normally?

Many thanks for a prompt reply on this.
lstocky
評比平均分數: -
In reply to Lloyd Stock

Re: Dependencies of Modules on PHP/MySQL

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Each version of Moodle has a minimum PHP version requirement. For lots of reasons you will need to decide the minimum Moodle version that your module will work with (you have to put it in version.php!). You should not use any features that are only in newer versions of PHP. Simple as that really.

MySQL is much less of an issue, as you should use the provided data access functions in the api. This will maximise your compatibility with all supported databases.

See also: http://docs.moodle.org/en/Installing_Moodle#Requirements
In reply to Howard Miller

Re: Dependencies of Modules on PHP/MySQL

Lloyd Stock發表於
Howard - thanks for this.
makes it a lot clearer.

where can I find information on version.php?




In reply to Lloyd Stock

Re: Dependencies of Modules on PHP/MySQL

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Well it's just one of the files that matters if you are writing your own module. There's not a lot of documentation for this unfortunately. I guess it's one of the more daunting tasks, but the best thing is to probably study the existing modules' code.