Slightly changing how Moodle version numbers work

Re: Slightly changing how Moodle version numbers work

by sam marshall -
Number of replies: 0
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I think if you are going to change it 'all over the code' in ANY way then it should be something like the following:

if(should_do_upgrade($oldversion,2006100401)) {
// ...
}

I.e. there should be no change to widespread areas of code that doesn't turn it into a function call of some sort - so that it can be changed in future without having to change it in every area of code AGAIN, breaking compatibility for module authors.

Once you do it that way there are a variety of different options for handling versions because it will be possible to treat 'legacy' code and 'new' code in a different way.

IIRC the reason for the slightly bizarre versioning in Moodle 1.9 is strictly because they are trying to achieve this without having to alter any existing upgrade.php code.

--sam