mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 03:04:05 +00:00
Add support for release channels (insider release channel) in Updater
This commit is contained in:
@@ -14,19 +14,19 @@ class Updater
|
||||
{
|
||||
use SiteApi;
|
||||
|
||||
public static function checkForUpdate($installed_version)
|
||||
public static function checkForUpdate($installed_version, $updater_channel = 'stable')
|
||||
{
|
||||
$data = null;
|
||||
$url = 'releases/update-check/'.$installed_version;
|
||||
$url = sprintf('releases/update-check/%s?channel=%s', $installed_version, $updater_channel);
|
||||
|
||||
$response = static::getRemote($url, ['timeout' => 100, 'track_redirects' => true]);
|
||||
|
||||
$data = (object) ['success' => false, 'release' => null];
|
||||
if ($response && ($response->getStatusCode() == 200)) {
|
||||
$data = $response->getBody()->getContents();
|
||||
$data = json_decode($data);
|
||||
}
|
||||
|
||||
$data = json_decode($data);
|
||||
|
||||
if ($data->success && $data->release && property_exists($data->release, 'extensions')) {
|
||||
$extensions = [];
|
||||
foreach ($data->release->extensions as $extension) {
|
||||
|
||||
Reference in New Issue
Block a user