From 23f08ef1442a5c42a77b8de6ebfb0cae0023d4c2 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 1 Feb 2026 08:46:39 +0200 Subject: [PATCH] formatting --- src/Appwrite/Platform/Workers/Migrations.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 3dd4c3f771..9ba9458c39 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -332,16 +332,9 @@ class Migrations extends Action $transfer = $source = $destination = null; - - /** - * Old logic - * $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; - * $endpoint = $protocol . '://' . $platform['apiHostname'] . '/v1'; - */ - $endpoint = System::getEnv('_APP_MIGRATION_ENDPOINT'); - if(empty($endpoint)){ - throw new \Exception('empty _APP_MIGRATION_ENDPOINT'); + if (empty($endpoint)) { + throw new \Exception('_APP_MIGRATION_ENDPOINT env is empty'); } try { @@ -355,6 +348,10 @@ class Migrations extends Action } } + if ($migration->getAttribute('destination') === DestinationAppwrite::getName()) { + + } + if (($credentials['endpoint'] ?? '') === 'http://localhost/v1') { $credentials['endpoint'] = $endpoint; } @@ -581,7 +578,8 @@ class Migrations extends Action ]); // Generate download URL with JWT - $endpoint = System::getEnv('_APP_DOMAIN', ''); + + $endpoint = System::getEnv('_APP_DOMAIN', ''); // Can use System::getEnv('_APP_MIGRATION_ENDPOINT'); ? $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled' ? 'https' : 'http'; $downloadUrl = "{$protocol}://{$endpoint}/v1/storage/buckets/{$bucketId}/files/{$fileId}/push?project={$project->getId()}&jwt={$jwt}"; $options['downloadUrl'] = $downloadUrl;