diff --git a/app/init/app.php b/app/init/app.php index 1cf34460c9..7ccf4ca88c 100644 --- a/app/init/app.php +++ b/app/init/app.php @@ -3,7 +3,7 @@ /** * App init * - * Initializes both common configs across HTTP, CLI and Workers + * Initializes common configs across HTTP, CLI and Workers * */ @@ -66,6 +66,19 @@ use Utopia\Validator\WhiteList; \error_reporting(E_ALL); +\stream_context_set_default([ // Set global user agent and http settings + 'http' => [ + 'method' => 'GET', + 'user_agent' => \sprintf( + APP_USERAGENT, + System::getEnv('_APP_VERSION', 'UNKNOWN'), + System::getEnv('_APP_EMAIL_SECURITY', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)) + ), + 'timeout' => 2, + ], +]); + + const APP_NAME = 'Appwrite'; const APP_DOMAIN = 'appwrite.io'; const APP_EMAIL_TEAM = 'team@localhost.test'; // Default email address @@ -1038,18 +1051,6 @@ foreach ($locales as $locale) { Locale::setLanguageFromJSON($code, $path); } -\stream_context_set_default([ // Set global user agent and http settings - 'http' => [ - 'method' => 'GET', - 'user_agent' => \sprintf( - APP_USERAGENT, - System::getEnv('_APP_VERSION', 'UNKNOWN'), - System::getEnv('_APP_EMAIL_SECURITY', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)) - ), - 'timeout' => 2, - ], -]); - function getDevice($root): Device {