dump db version
[openemr.git] / common / compatibility / Checker.php
blobaf9cbba755ea83e94e5845bfabdf3a3aff2fa76d
1 <?php
3 namespace OpenEMR\Common;
5 /**
6 * Check if the server's PHP version is compatible with OpenEMR.
8 * Note that this will only be used within setup.php, sql_upgrade.php,
9 * sql_patch.php, acl_upgrade.php, admin.php, and globals.php.
11 * @package OpenEMR
12 * @author Matthew Vita <matthewvita48@gmail.com>
13 * @link http://www.open-emr.org
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 * @copyright Copyright (c) 2017 Matthew Vita
17 class Checker
19 private static $minimumPhpVersion = "7.1.0";
21 private static function xlDelegate($value)
23 if (function_exists("xl")) {
24 return xl($value);
27 return $value;
30 /**
31 * Checks to see if minimum PHP version is met.
33 * @return bool | warning string
35 public static function checkPhpVersion()
37 $phpCheck = self::isPhpSupported();
38 $response = "";
40 if (!$phpCheck) {
41 $response .= self::xlDelegate("PHP version needs to be at least") . " " . self::$minimumPhpVersion . ".";
42 } else {
43 $response = true;
46 return $response;
49 /**
50 * Checks to see if minimum PHP version is met.
52 * @return bool
54 private static function isPhpSupported()
56 return version_compare(phpversion(), self::$minimumPhpVersion, ">=");