Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ public function __construct()
// echo "<pre>" . json_encode($this->webguiGlobals, JSON_PRETTY_PRINT) . "</pre>";

$this->var = $webguiGlobals['var'];

// If we're on a patch, we need to use the combinedVersion to check for updates
if (file_exists('/tmp/Patcher/patches.json')) {
$patchJson = @json_decode(@file_get_contents('/tmp/Patcher/patches.json'), true) ?: [];
$this->var['version'] = $patchJson['combinedVersion'] ?? $this->var['version'];
}

$this->nginxCfg = @parse_ini_file('/var/local/emhttp/nginx.ini') ?? [];

$this->state = strtoupper(empty($this->var['regCheck']) ? $this->var['regTy'] : $this->var['regCheck']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,14 @@ function _($text) {return $text;}

$params = [];
$params['branch'] = plugin('category', self::PLG_PATH, 'stable');
$params['current_version'] = plugin('version', self::PLG_PATH) ?: _var($var,'version');
// Get current version from patches.json if it exists, otherwise fall back to plugin version or var.ini
$patcherVersion = null;
if (file_exists('/tmp/Patcher/patches.json')) {
$patcherData = @json_decode(file_get_contents('/tmp/Patcher/patches.json'), true);
$patcherVersion = $patcherData['combinedVersion'] ?? null;
}

$params['current_version'] = $patcherVersion ?: plugin('version', self::PLG_PATH) ?: _var($var, 'version');
if (_var($var,'regExp')) $params['update_exp'] = date('Y-m-d', _var($var,'regExp')*1);
$defaultUrl = self::BASE_RELEASES_URL;
// pass a param of altUrl to use the provided url instead of the default
Expand Down
Loading