From 0706a6f47d2cc71da70d70412e6fe45c4443480b Mon Sep 17 00:00:00 2001 From: prplwtf Date: Wed, 13 May 2026 13:23:18 +0200 Subject: [PATCH 1/2] feat: use proper http client for bp:meta command --- .../Commands/BlueprintFramework/MetadataCacheCommand.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/BlueprintFramework/MetadataCacheCommand.php b/app/Console/Commands/BlueprintFramework/MetadataCacheCommand.php index b2ee1bb4..5ec435a8 100644 --- a/app/Console/Commands/BlueprintFramework/MetadataCacheCommand.php +++ b/app/Console/Commands/BlueprintFramework/MetadataCacheCommand.php @@ -13,6 +13,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Http; use Pterodactyl\Models\ExtensionCachedMetadata; use Pterodactyl\BlueprintFramework\Services\PlaceholderService\BlueprintPlaceholderService; use Pterodactyl\BlueprintFramework\Libraries\ExtensionLibrary\Console\BlueprintConsoleLibrary as BlueprintExtensionLibrary; @@ -41,12 +42,8 @@ public function handle() $installedExtensions = $this->blueprint->extensions(); // get version info - $context = stream_context_create(['http' => ['method' => 'GET', 'header' => 'User-Agent: BlueprintFramework']]); - $remoteVersions = @file_get_contents( - $this->PlaceholderService->api_url() . '/api/extensions/latest', - false, - $context - ); + $res = Http::get($this->PlaceholderService->api_url() . '/api/extensions/latest'); + $remoteVersions = $res->body(); if($remoteVersions) { $remoteVersionsData = json_decode($remoteVersions, true); From 14c432ebaee089c8e8aaaf6abc3657ccea766519 Mon Sep 17 00:00:00 2001 From: prplwtf Date: Wed, 13 May 2026 13:26:12 +0200 Subject: [PATCH 2/2] feat: use proper http client for bp:version:cache command --- .../Version/VersionCacheCommand.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/app/Console/Commands/BlueprintFramework/Version/VersionCacheCommand.php b/app/Console/Commands/BlueprintFramework/Version/VersionCacheCommand.php index 3dff837e..40eef235 100644 --- a/app/Console/Commands/BlueprintFramework/Version/VersionCacheCommand.php +++ b/app/Console/Commands/BlueprintFramework/Version/VersionCacheCommand.php @@ -3,6 +3,7 @@ namespace Pterodactyl\Console\Commands\BlueprintFramework\Version; use Illuminate\Console\Command; +use Illuminate\Support\Facades\Http; use Pterodactyl\BlueprintFramework\Services\PlaceholderService\BlueprintPlaceholderService; use Pterodactyl\BlueprintFramework\Libraries\ExtensionLibrary\Console\BlueprintConsoleLibrary as BlueprintExtensionLibrary; @@ -20,22 +21,16 @@ public function __construct( public function handle() { - $api_url = $this->PlaceholderService->api_url() . '/api/latest'; - $context = stream_context_create([ - 'http' => [ - 'method' => 'GET', - 'header' => 'User-Agent: BlueprintFramework', - ], - ]); - $response = @file_get_contents($api_url, false, $context); + $res = Http::get($this->PlaceholderService->api_url() . '/api/latest'); + $body = $res->body(); - if ($response === false || empty($response)) { + if ($body === false || empty($body)) { $this->blueprint->dbSet('blueprint', 'internal:version:latest', 'unknown'); return false; } - if ($response) { - $cleaned_response = preg_replace('/[[:^print:]]/', '', $response); + if ($body) { + $cleaned_response = preg_replace('/[[:^print:]]/', '', $body); $data = json_decode($cleaned_response, true); if (isset($data['name'])) { $latest_version = $data['name'];