mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Minor improvements (#1676)
* Minor improvements * Update functions.php * Update common.php * Update init_bb.php * Updated * Update build_files_integrity.php * Updated * Update CHANGELOG.md * Update legacy-changes.txt * Update legacy-changes.txt * Update legacy-changes.txt * Update .gitignore * Update legacy-changes.txt
This commit is contained in:
parent
e1f03e64dd
commit
4dcee993cc
9 changed files with 55 additions and 94 deletions
|
@ -19,17 +19,29 @@ $updaterDownloader = new \TorrentPier\Updater();
|
|||
$updaterDownloader = $updaterDownloader->getLastVersion();
|
||||
|
||||
$getVersion = $updaterDownloader['tag_name'];
|
||||
$versionCodeActual = (int)trim(str_replace(['.', 'v'], '', $getVersion));
|
||||
$versionCodeActual = version_code($getVersion);
|
||||
|
||||
// Has update!
|
||||
if (VERSION_CODE < $versionCodeActual) {
|
||||
$latestBuildFileLink = $updaterDownloader['assets'][0]['browser_download_url'];
|
||||
|
||||
// Check updater file
|
||||
$updater_file = readUpdaterFile();
|
||||
$updater_need_replaced = !empty($updater_file) && ($updater_file['latest_version']['short_code'] < $versionCodeActual);
|
||||
|
||||
// Save current version & latest available
|
||||
file_write(json_encode([
|
||||
'previous_version' => VERSION_CODE,
|
||||
'latest_version' => $versionCodeActual
|
||||
]), UPDATER_FILE, replace_content: true);
|
||||
if (!is_file(UPDATER_FILE) || $updater_need_replaced) {
|
||||
file_write(json_encode([
|
||||
'previous_version' => [
|
||||
'short_code' => VERSION_CODE,
|
||||
'version' => $bb_cfg['tp_version']
|
||||
],
|
||||
'latest_version' => [
|
||||
'short_code' => $versionCodeActual,
|
||||
'version' => $getVersion
|
||||
]
|
||||
]), UPDATER_FILE, replace_content: true);
|
||||
}
|
||||
|
||||
// Get MD5 checksum
|
||||
$buildFileChecksum = '';
|
||||
|
|
|
@ -13,7 +13,8 @@ if (!defined('BB_ROOT')) {
|
|||
|
||||
global $bb_cfg;
|
||||
|
||||
if (!$bb_cfg['integrity_check'] || is_dir(BB_ROOT . '.git')) {
|
||||
// TODO: if (!local environment) { ... }
|
||||
if (!$bb_cfg['integrity_check']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue