add interval for external update-check; add parameter 'force' to Froxlor.checkUpdate() API call; fix session/language update when changing language

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-07-24 11:47:10 +02:00
parent 771d6c483a
commit b6267e610a
9 changed files with 84 additions and 45 deletions

View File

@@ -27,6 +27,7 @@ namespace Froxlor\Install;
use Froxlor\Froxlor;
use Froxlor\FroxlorLogger;
use Froxlor\Settings;
class Update
{
@@ -106,4 +107,24 @@ class Update
return Froxlor::versionCompare2($current_version, $version_to_check) == -1;
}
public static function storeUpdateCheckData(array $response)
{
$data = [
'ts' => time(),
'channel' => Settings::Get('system.update_channel'),
'data' => $response
];
Settings::Set('system.updatecheck_data', json_encode($data));
}
public static function getUpdateCheckData()
{
$uc_data = Settings::Get('system.updatecheck_data');
if (!empty($uc_data)) {
$data = json_decode($uc_data, true);
return $data;
}
return null;
}
}