From 81c3d966297e6cd9582b0a4b360bc6b672277c82 Mon Sep 17 00:00:00 2001 From: Khushboo Verma Date: Mon, 14 Apr 2025 14:00:44 +0000 Subject: [PATCH] Consistent naming --- app/controllers/api/functions.php | 6 +++--- src/Appwrite/Platform/Workers/Builds.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 5849de9dd9..abf7b58e59 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1312,14 +1312,14 @@ App::post('/v1/functions/:functionId/deployments') throw new Exception(Exception::STORAGE_FILE_EMPTY, 'No file sent'); } - $functionFileSize = (System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT') ?: 30000000); + $functionSizeLimit = System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000'); if (isset($plan['functionSize'])) { - $functionFileSize = $plan['functionSize'] * 1000 * 1000; + $functionSizeLimit = $plan['functionSize'] * 1000 * 1000; } $fileExt = new FileExt([FileExt::TYPE_GZIP]); - $fileSizeValidator = new FileSize($functionFileSize); + $fileSizeValidator = new FileSize($functionSizeLimit); $upload = new Upload(); // Make sure we handle a single file and multiple files the same way diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index f86f776ffb..f6e8726c07 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -405,9 +405,9 @@ class Builds extends Action $directorySize = $localDevice->getDirectorySize($tmpDirectory); - $functionsSizeLimit = (int) (System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT') ?: 30000000); + $functionsSizeLimit = (int)System::getEnv('_APP_FUNCTIONS_SIZE_LIMIT', '30000000'); - if (!empty($plan['functionSize'])) { + if (isset($plan['functionSize'])) { $functionsSizeLimit = (int) $plan['functionSize'] * 1000 * 1000; }