Updated getEnv to use system lib

This commit is contained in:
Eldad Fux
2024-04-01 13:02:47 +02:00
parent ffbf3c0058
commit 8ed1da4ea8
60 changed files with 464 additions and 437 deletions
+3 -3
View File
@@ -8,7 +8,6 @@ use Appwrite\Event\Delete;
use Appwrite\Event\Func;
use Appwrite\Event\Hamster;
use Appwrite\Platform\Appwrite;
use Utopia\App;
use Utopia\Cache\Adapter\Sharding;
use Utopia\Cache\Cache;
use Utopia\CLI\CLI;
@@ -22,6 +21,7 @@ use Utopia\Platform\Service;
use Utopia\Pools\Group;
use Utopia\Queue\Connection;
use Utopia\Registry\Registry;
use Utopia\System\System;
Authorization::disable();
@@ -145,7 +145,7 @@ CLI::setResource('logError', function (Registry $register) {
$logger = $register->get('logger');
if ($logger) {
$version = App::getEnv('_APP_VERSION', 'UNKNOWN');
$version = System::getEnv('_APP_VERSION', 'UNKNOWN');
$log = new Log();
$log->setNamespace($namespace);
@@ -164,7 +164,7 @@ CLI::setResource('logError', function (Registry $register) {
$log->setAction($action);
$isProduction = App::getEnv('_APP_ENV', 'development') === 'production';
$isProduction = System::getEnv('_APP_ENV', 'development') === 'production';
$log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING);
$responseCode = $logger->addLog($log);