For #691736: Vbulletin 4 Support and other issues, it would be helpful to automatically determine the installed version of vB.

As we're asking users to provide config.php as copy or link in the module's directory and the version is contained in that, we should be able to simply parse it.

Comments

edb’s picture

StatusFileSize
new1.7 KB

Good idea!

+ $file = fopen($file, 'r');
This should take $config_file as the parameter (patch attached). Other than that, this works great. We need to keep in mind that new versions of vBulletin could break this quite easily so any code using the version number provided by this should not rely on $config['version'] being set.

sun’s picture

StatusFileSize
new2.14 KB

Good catch! Thanks for reviewing and re-rolling!

Committed to 6.x-2.x.

We need to keep in mind that new versions of vBulletin could break this quite easily so any code using the version number provided by this should not rely on $config['version'] being set.

That's less of an issue IMO, since a range of other issues basically makes config.php and the successful version parsing a hard requirement to use the module.

In other words: Without the version, we're not going to be able to make the integration work at all.

Speaking of requirements, let's enforce this.

Attached follow-up patch adds a hook_requirements() implementation to verify that config.php has been provided in the module directory (which disallows the installation otherwise).

sun’s picture

Status: Needs review » Fixed

Manually tested #2 and committed to 6.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.