Skip to content

Commit

Permalink
MDL-25186: add environmental check to recommend PHP 5.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Rossiani Wijaya committed Dec 23, 2010
1 parent 0300e58 commit 0595189
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions admin/environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/customcheckslib.php" function="php_check_php533" level="optional">
<FEEDBACK>
<ON_CHECK message="php533warning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
1 change: 1 addition & 0 deletions lang/en_utf8/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@
$string['pgcluster'] = 'PostgreSQL Cluster';
$string['pgclusterdescription'] = 'PostgreSQL version/cluster parameter for command line operations. If you only have one postgresql on your system or you are not sure what this is, leave this blank.';
$string['php50restricted'] = 'PHP 5.0.x has a number of known problems, please upgrade to 5.1.x or downgrade to 4.3.x or 4.4.x';
$string['php533warning'] = 'PHP 5.3.3 and upwards is recommended';
$string['phpfloatproblem'] = 'Detected unexpected problem in handling of PHP float numbers - $a';
$string['pleaseregister'] = 'Please register your site to remove this button';
$string['pleaserefreshregistration'] = 'Your site has been registered with moodle.org, please consider updating the registration if significant changes happened since your last update, on $a';
Expand Down
8 changes: 8 additions & 0 deletions lib/customcheckslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@ function php_check_register_globals($result) {
return $result;
}

function php_check_php533($result) {
if (version_compare(phpversion(), '5.3.3') < 0) {
$result->status = false;
} else {
$result = null;
}
return $result;
}
?>

0 comments on commit 0595189

Please sign in to comment.