From 4fd5d60802d495d6014caefa309cda0e7ac5ed88 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:19:06 +0700 Subject: [PATCH] Fix: Resolve broken references in RootCaApiController & OpenSslService --- app/Http/Controllers/Api/RootCaApiController.php | 12 +++++++----- app/Services/OpenSslService.php | 7 +++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Api/RootCaApiController.php b/app/Http/Controllers/Api/RootCaApiController.php index 4464040..1be6785 100644 --- a/app/Http/Controllers/Api/RootCaApiController.php +++ b/app/Http/Controllers/Api/RootCaApiController.php @@ -10,10 +10,12 @@ use Illuminate\Http\Request; class RootCaApiController extends Controller { protected $sslService; + protected $installerService; - public function __construct(OpenSslService $sslService) + public function __construct(OpenSslService $sslService, \App\Services\CaInstallerService $installerService) { $this->sslService = $sslService; + $this->installerService = $installerService; } public function index() @@ -96,7 +98,7 @@ class RootCaApiController extends Controller $certificates = CaCertificate::all(); $count = 0; foreach ($certificates as $cert) { - if ($this->sslService->uploadIndividualInstallersOnly($cert, $mode)) { + if ($this->installerService->uploadIndividualInstallersOnly($cert, $mode)) { $count++; } } @@ -110,7 +112,7 @@ class RootCaApiController extends Controller { $this->authorizeAdminOrOwner(); try { - if ($this->sslService->syncAllBundles()) { + if ($this->installerService->syncAllBundles()) { return response()->json(['status' => 'success', 'message' => "Successfully synced All-in-One bundles."]); } return response()->json(['status' => 'error', 'message' => 'No certificates found to bundle.'], 404); @@ -130,13 +132,13 @@ class RootCaApiController extends Controller foreach ($certificates as $cert) { if ($this->sslService->uploadPublicCertsOnly($cert, $mode)) { - $this->sslService->uploadIndividualInstallersOnly($cert, $mode); + $this->installerService->uploadIndividualInstallersOnly($cert, $mode); $count++; } } // Also sync bundles (Always 'latest' as bundles are aggregate) - $this->sslService->syncAllBundles(); + $this->installerService->syncAllBundles(); return response()->json([ 'status' => 'success', diff --git a/app/Services/OpenSslService.php b/app/Services/OpenSslService.php index 3036673..9fb87de 100644 --- a/app/Services/OpenSslService.php +++ b/app/Services/OpenSslService.php @@ -468,7 +468,9 @@ class OpenSslService } // 4. Final Mass Sync - $this->syncAllBundles(); + // 4. Final Mass Sync + $installerService = app(\App\Services\CaInstallerService::class); + $installerService->syncAllBundles(); return true; } @@ -503,7 +505,8 @@ class OpenSslService // Sync to CDN $this->uploadPublicCertsOnly($newCert, 'both'); - $this->uploadIndividualInstallersOnly($newCert, 'both'); + $installerService = app(\App\Services\CaInstallerService::class); + $installerService->uploadIndividualInstallersOnly($newCert, 'both'); return $newCert; }