2020-03-07 23:15:11 +01:00
|
|
|
<?php
|
2020-04-30 13:45:47 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
2020-03-07 23:15:11 +01:00
|
|
|
|
|
|
|
namespace App\Jobs\Util;
|
|
|
|
|
2020-03-08 06:59:06 +01:00
|
|
|
use App\Models\Account;
|
2020-03-07 23:15:11 +01:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
|
|
|
|
class VersionCheck implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$version_file = file_get_contents(config('ninja.version_url'));
|
|
|
|
|
2020-07-06 00:28:19 +02:00
|
|
|
info("latest version = {$version_file}");
|
|
|
|
|
2020-03-21 06:37:30 +01:00
|
|
|
if ($version_file) {
|
2020-03-08 06:59:06 +01:00
|
|
|
Account::whereNotNull('id')->update(['latest_version' => $version_file]);
|
2020-03-21 06:37:30 +01:00
|
|
|
}
|
2020-03-07 23:15:11 +01:00
|
|
|
}
|
|
|
|
}
|