Harmonize version reporting in ui and api

Everything should use the version from the VERSION file created by the installer like this.
This commit is contained in:
Lucas Bickel 2017-03-10 20:28:54 +01:00
parent e3785e25f9
commit bd18caf69d
8 changed files with 23 additions and 31 deletions

View file

@ -865,23 +865,12 @@ class Application_Model_Preference
self::setValue("schema_version", $version);
}
public static function GetAirtimeVersion()
{
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development" && function_exists('exec')) {
$version = exec("git rev-parse --short HEAD 2>/dev/null", $out, $return_code);
if ($return_code == 0) {
return self::getValue("system_version")."+".$version.":".time();
}
}
return self::getValue("system_version");
}
public static function GetLatestVersion()
{
$config = Config::getConfig();
$latest = self::getValue("latest_version");
if ($latest == null || strlen($latest) == 0) {
return self::GetAirtimeVersion();
return $config['airtime_version'];
} else {
return $latest;
}