mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-07-16 22:05:20 +00:00
refactor(services): move Updater to app/Support/Update
Updater is a pure static procedural class — all eight public methods (checkForUpdate, download, unzip, copyFiles, deleteFiles, cleanStaleFiles, migrateUpdate, finishUpdate) are static, there's no constructor, no DI, no instance state. It's stateless self-update plumbing, same character as the Setup/ helpers that moved to Support/ in commit 6d1816bd.
Moving it out of Services/ leaves Services/ exclusively for DI-injected classes with real business logic, which is the contract the reorg was aiming for. Update/ now lives next to Setup/ in Support/ where the other install/upgrade-time utilities live.
Only 3 consumers needed touching: UpdateController, UpdateCommand, and a reference in config/invoiceshelf.php's comment. 350 tests still pass.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\Update\Updater;
|
||||
use App\Support\Update\Updater;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Update\Updater;
|
||||
use App\Support\Update\Updater;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Update;
|
||||
namespace App\Support\Update;
|
||||
|
||||
use App\Events\UpdateFinished;
|
||||
use App\Models\Setting;
|
||||
@@ -45,7 +45,7 @@ return [
|
||||
* Marketplace and updater base URL.
|
||||
*
|
||||
* The marketplace client (App\Services\Module\ModuleInstaller) and the
|
||||
* updater (App\Services\Update\Updater) both build their HTTP client base
|
||||
* updater (App\Support\Update\Updater) both build their HTTP client base
|
||||
* URI from this value via App\Traits\SiteApi::getRemote(). Override via
|
||||
* INVOICESHELF_BASE_URL in .env to point a self-hosted instance or local
|
||||
* dev environment at a non-production marketplace (e.g. a local checkout
|
||||
|
||||
Reference in New Issue
Block a user