Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-25186: add environmental check to recommend PHP 5.3.3

  • Loading branch information...
commit 059518944a163f8c26ac944096364e70dbea4f64 1 parent 0300e58
rwijaya authored
5  admin/environment.xml
@@ -321,6 +321,11 @@
321 321
       </PHP_SETTING>
322 322
     </PHP_SETTINGS>
323 323
     <CUSTOM_CHECKS>
  324
+        <CUSTOM_CHECK file="lib/customcheckslib.php" function="php_check_php533" level="optional">
  325
+        <FEEDBACK>
  326
+          <ON_CHECK message="php533warning" />
  327
+        </FEEDBACK>
  328
+      </CUSTOM_CHECK>
324 329
     </CUSTOM_CHECKS>
325 330
   </MOODLE>
326 331
 </COMPATIBILITY_MATRIX>
1  lang/en_utf8/admin.php
@@ -588,6 +588,7 @@
588 588
 $string['pgcluster'] = 'PostgreSQL Cluster';
589 589
 $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.';
590 590
 $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';
  591
+$string['php533warning'] = 'PHP 5.3.3 and upwards is recommended';
591 592
 $string['phpfloatproblem'] = 'Detected unexpected problem in handling of PHP float numbers - $a';
592 593
 $string['pleaseregister'] = 'Please register your site to remove this button';
593 594
 $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';
8  lib/customcheckslib.php
@@ -54,4 +54,12 @@ function php_check_register_globals($result) {
54 54
     return $result;
55 55
 }
56 56
 
  57
+function php_check_php533($result) {
  58
+    if (version_compare(phpversion(), '5.3.3') < 0) {
  59
+        $result->status = false;
  60
+    } else {
  61
+        $result = null;
  62
+    }
  63
+    return $result;
  64
+}
57 65
 ?>

0 notes on commit 0595189

Please sign in to comment.
Something went wrong with that request. Please try again.