diff --git a/application/Espo/Core/Utils/System.php b/application/Espo/Core/Utils/System.php index 6cfa2c4181..6ca94c9b37 100644 --- a/application/Espo/Core/Utils/System.php +++ b/application/Espo/Core/Utils/System.php @@ -101,4 +101,20 @@ class System { return (defined("PHP_BINDIR"))? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : 'php'; } + + /** + * Get php version (only digits and dots) + * + * @return string + */ + public static function getPhpVersion() + { + $version = phpversion(); + + if (preg_match('/^[0-9\.]+[0-9]/', $version, $matches)) { + return $matches[0]; + } + + return $version; + } } \ No newline at end of file