2024.8.23
Loading...
Searching...
No Matches
ajax.latestversion.php File Reference

Go to the source code of this file.

Variables

global $bearsamppCore
 
 $bearsamppCurrentVersion = $bearsamppCore->getAppVersion()
 
global $bearsamppLang
 
 $githubLatestVersion = $githubVersionData['version']
 
 $githubLatestVersionUrl = $githubVersionData['html_url']
 
global $githubVersionData = Util::getLatestVersion(APP_GITHUB_LATEST_URL)
 
 $githubVersionName = $githubVersionData['name']
 
 $result
 
if(!empty($githubVersionData)) else
 
 if (version_compare( $bearsamppCurrentVersion, $githubLatestVersion, '<'))
 

Variable Documentation

◆ $bearsamppCore

◆ $bearsamppCurrentVersion

$bearsamppCurrentVersion = $bearsamppCore->getAppVersion()

Definition at line 32 of file ajax.latestversion.php.

◆ $bearsamppLang

global $bearsamppLang

Constructs the download link for a new version if available.

This function compares the current application version with the latest available version. If the latest version is greater, it sets the display flag to true and constructs an HTML link for downloading the new version, appending it to the 'download' key in the result array.

Parameters
array$resultHolds the display flag and download link HTML.
Returns
void Modifies the $result array by reference. @global object $bearsamppLang Language management object, used for retrieving language-specific values. @global object $bearsamppCore Core application object, used for retrieving the current version. @global array $githubVersionData Holds the latest version data retrieved from GitHub.

Definition at line 24 of file ajax.latestversion.php.

◆ $githubLatestVersion

$githubLatestVersion = $githubVersionData['version']

◆ $githubLatestVersionUrl

$githubLatestVersionUrl = $githubVersionData['html_url']

Definition at line 66 of file ajax.latestversion.php.

◆ $githubVersionData

Retrieves the latest version data from GitHub.

Returns
array|null Returns an array with version data or null if retrieval fails.

Definition at line 24 of file ajax.latestversion.php.

Referenced by ActionCheckVersion\__construct().

◆ $githubVersionName

$githubVersionName = $githubVersionData['name']

Definition at line 67 of file ajax.latestversion.php.

◆ $result

$result
Initial value:
= array(
'display' => false,
'download' => '',
)

Definition at line 26 of file ajax.latestversion.php.

◆ else

if (!empty( $githubVersionData)) else
Initial value:
{
Util::logError('No data available in $githubVersionData')
static logError($data, $file=null)

Definition at line 44 of file ajax.latestversion.php.

◆ if

if(version_compare($bearsamppCurrentVersion, $githubLatestVersion, '<')) ( version_compare( $bearsamppCurrentVersion, $githubLatestVersion, '<') )

Compares the current version with the latest version.

If the latest version is greater, sets the display flag to true and constructs the download link.

Parameters
string$bearsamppCurrentVersionThe current version of the application.
string$githubLatestVersionThe latest version of the application.
Returns
void Modifies the $result array by reference. Outputs the result array as a JSON string.
Parameters
array$resultThe result array containing the display flag and download link.
Returns
void Outputs the JSON-encoded result.

Definition at line 79 of file ajax.latestversion.php.