make cronjobs also classes and began to refactor the whole cronjob stuff

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-19 08:55:23 +01:00
parent a25150babf
commit 903b775f79
52 changed files with 460 additions and 523 deletions

View File

@@ -53,4 +53,46 @@ final class Froxlor
{
return self::getFullVersion() . ' (' . self::DBVERSION . ')';
}
/**
* Function hasUpdates
*
* checks if a given version is not equal the current one
*
* @param string $to_check
* version to check, if empty current version is used
*
* @return bool true if version to check does not match, else false
*/
public static function hasUpdates($to_check = null)
{
if (empty($to_check)) {
$to_check = self::VERSION;
}
if (Settings::Get('panel.version') == null || Settings::Get('panel.version') != $to_check) {
return true;
}
return false;
}
/**
* Function hasUpdates
*
* checks if a given database-version is not equal the current one
*
* @param int $to_check
* version to check, if empty current dbversion is used
*
* @return bool true if version to check does not match, else false
*/
public static function hasDbUpdates($to_check = null)
{
if (empty($to_check)) {
$to_check = self::DBVERSION;
}
if (Settings::Get('panel.db_version') == null || Settings::Get('panel.db_version') != $to_check) {
return true;
}
return false;
}
}