mirror of
https://github.com/friendica/friendica
synced 2025-04-29 05:04:24 +02:00
Add admin info to stats Endpoint
This commit is contained in:
parent
e8ab8a84af
commit
7ca4e6e338
4 changed files with 80 additions and 14 deletions
|
@ -24,6 +24,44 @@ class Update
|
|||
|
||||
const NEW_TABLE_STRUCTURE_VERSION = 1288;
|
||||
|
||||
/**
|
||||
* Returns the status of the current update
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getStatus(): int
|
||||
{
|
||||
return (int)DI::config()->get('system', 'update') ?? static::SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the latest Version of the Friendica git repository and null, if this node doesn't check updates automatically
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getAvailableVersion(): ?string
|
||||
{
|
||||
return DI::keyValue()->get('git_friendica_version') ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true, if there's a new update and null if this node doesn't check updates automatically
|
||||
*
|
||||
* @return bool|null
|
||||
*/
|
||||
public static function isAvailable(): ?bool
|
||||
{
|
||||
if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') {
|
||||
if (version_compare(App::VERSION, static::getAvailableVersion()) < 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to check if the Database structure needs an update.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue