/**
* 获取当前系统版本号
* @return mixed|null
* @throws Exception
*/
function get_version()
{
static $version = null;
if ($version) {
return $version;
}
$file = dirname(ROOT_PATH) . '/version.json';
if (!file_exists($file)) {
throw new Exception('version.json not found');
}
$version = json_decode(file_get_contents($file), true);
if (!is_array($version)) {
throw new Exception('version cannot be decoded');
}
return $version['version'];
}