* Remove the autoupdater #1133 * Remove self-updater package * Package still needed :|
This commit is contained in:
@@ -3,49 +3,32 @@
|
||||
namespace App\Http\Controllers\System;
|
||||
|
||||
use App\Contracts\Controller;
|
||||
use App\Repositories\KvpRepository;
|
||||
use App\Services\AnalyticsService;
|
||||
use App\Services\Installer\InstallerService;
|
||||
use App\Services\Installer\MigrationService;
|
||||
use App\Services\Installer\SeederService;
|
||||
use Codedge\Updater\UpdaterManager;
|
||||
use function count;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
private $analyticsSvc;
|
||||
private $installerSvc;
|
||||
private $kvpRepo;
|
||||
private $migrationSvc;
|
||||
private $seederSvc;
|
||||
private $updateManager;
|
||||
|
||||
/**
|
||||
* @param AnalyticsService $analyticsSvc
|
||||
* @param InstallerService $installerSvc
|
||||
* @param KvpRepository $kvpRepo
|
||||
* @param MigrationService $migrationSvc
|
||||
* @param SeederService $seederSvc
|
||||
* @param UpdaterManager $updateManager
|
||||
*/
|
||||
public function __construct(
|
||||
AnalyticsService $analyticsSvc,
|
||||
InstallerService $installerSvc,
|
||||
KvpRepository $kvpRepo,
|
||||
MigrationService $migrationSvc,
|
||||
SeederService $seederSvc,
|
||||
UpdaterManager $updateManager
|
||||
SeederService $seederSvc
|
||||
) {
|
||||
$this->analyticsSvc = $analyticsSvc;
|
||||
$this->migrationSvc = $migrationSvc;
|
||||
$this->seederSvc = $seederSvc;
|
||||
$this->installerSvc = $installerSvc;
|
||||
$this->kvpRepo = $kvpRepo;
|
||||
$this->updateManager = $updateManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,38 +90,4 @@ class UpdateController extends Controller
|
||||
{
|
||||
return redirect('/admin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the update page with the latest version
|
||||
*
|
||||
* @return Factory|View
|
||||
*/
|
||||
public function updater()
|
||||
{
|
||||
$version = $this->kvpRepo->get('latest_version_tag');
|
||||
|
||||
return view('system.updater.downloader/downloader', [
|
||||
'version' => $version,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the actual update and then forward the user to the updater page
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function update_download()
|
||||
{
|
||||
$version = $this->kvpRepo->get('latest_version_tag');
|
||||
if (empty($version)) {
|
||||
return view('system.updater.steps.step1-no-update');
|
||||
}
|
||||
|
||||
$release = $this->updateManager->source('github')->fetch($version);
|
||||
$this->updateManager->source('github')->update($release);
|
||||
$this->analyticsSvc->sendUpdate();
|
||||
|
||||
Log::info('Update completed to '.$version.', redirecting');
|
||||
return redirect('/update');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user