When you first install version control API and eable it through the module page you will be prompted with the following error message:
Parse error: syntax error, unexpected '=', expecting ')' in /var/www/modules/versioncontrol/versioncontrol.module on line 800
This will remain no matter which page you visit on your site until the problem is fixed. That line in the code is:
function versioncontrol_get_commits($constraints = array(), &$result_count = NULL, $page = NULL, $limit = 10) {
Comments
Comment #1
jpetso commentedI see nothing wrong with this line... in fact, it looks the same on my system and there it works flawlessly. Also, the error message doesn't make *any* sense for this line. I'm sorry to close this bug as invalid, but there must be some error on your system. (On an unrelated note, you should also not be installing contributed modules in modules/ but rather in the sites/all/modules/ directory... but that is probably not the cause of your error.)
Comment #2
jpetso commentedAs most possible cause for this I would probably suspect a PHP version from the stone age or earlier that did not support default values yet. However even PHP 4.4.x (and probably much earlier) can do this, so I'd really be surprised if a PHP version still exists that can't do default values.
Comment #3
jpetso commentedHm... reading up on the PHP manual, it seems that default values by reference (as used in this function) are only supported in PHP 5 or later. So, sorry about the claim above, it's obviously incorrect then as you can't even do that in the latest PHP 4.
So for fixing this bug, I've got two choices:
1) Redesign the API so that this parameter doesn't take any default value (painful, as it's not supposed to be used under normal circumstances), or
2) Document this in the README.txt and on the project page, and state that Version Control API doesn't run on PHP 4.
To be honest, I really prefer option 2, as a) PHP 4 won't be supported anymore after 2007 (which is in three weeks already) and b) Version Control API is a new module, so it doesn't break for users where it worked before.
Please upgrade to PHP 5, you should be doing that anyways from a security point of view in the next couple of weeks. Sorry for being an asshole, but there *are* good reasons for not accomodating this for PHP 4.
Leaving the issue open until the documentation work has been done.
Comment #4
hunmonk commentedadded a CAVEATS section to the README.txt to inform the user that the module doesn't work with PHP < 5.
leaving this open for now, because when we port to 6.x, we'll want to remove the documentation from the README and add the PHP compatibility parameter to the .info file.
Comment #5
jpetso commentedHEAD (which will become 6.x-1.x) has the PHP requirement moved from README.txt to versioncontrol.info, thus, fixed.