added getPhpVersion()

This commit is contained in:
Taras Machyshyn
2015-02-09 17:07:06 +02:00
parent 00b0c904ae
commit 2bc7f85a58

View File

@@ -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;
}
}