Commit 72d12ea8 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols
Browse files

Adjust php version check to pass the error message the version number (Fixes #617187).



The current version check uses a hard-coded string in the error message.
If the php version requirements for Mahara change in the future, then all
languages packs will have to be updated.

Rather than doing this every time, we can pass the required version to
get_string to substitute in instead.
Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 177c1eb6
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
// @todo<nigel>: most likely need much better descriptions here for these environment issues
$string['phpversion'] = 'Mahara will not run on PHP < 5.1.3. Please upgrade your PHP version, or move Mahara to a different host.';
$string['phpversion'] = 'Mahara will not run on PHP < %s. Please upgrade your PHP version, or move Mahara to a different host.';
$string['jsonextensionnotloaded'] = 'Your server configuration does not include the JSON extension. Mahara requires this in order to send some data to and from the browser. Please make sure that it is loaded in php.ini, or install it if it is not installed.';
$string['pgsqldbextensionnotloaded'] = 'Your server configuration does not include the pgsql extension. Mahara requires this in order to store data in a relational database. Please make sure that it is loaded in php.ini, or install it if it is not installed.';
$string['mysqldbextensionnotloaded'] = 'Your server configuration does not include the mysql extension. Mahara requires this in order to store data in a relational database. Please make sure that it is loaded in php.ini, or install it if it is not installed.';
......
......@@ -35,8 +35,9 @@ defined('INTERNAL') || die();
function ensure_sanity() {
// PHP version
if (version_compare(phpversion(), '5.2.0') < 0) {
throw new ConfigSanityException(get_string('phpversion', 'error'));
$phpversionrequired = '5.2.0';
if (version_compare(phpversion(), $phpversionrequired) < 0) {
throw new ConfigSanityException(get_string('phpversion', 'error', $phpversionrequired));
}
// Various required extensions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment