From b1cc203eba07261ad2ef06d61347789e2b2d9d07 Mon Sep 17 00:00:00 2001 From: shimon Date: Sun, 3 Aug 2025 18:38:38 +0300 Subject: [PATCH] composer --- app/config/collections/common.php | 4 ++-- app/init/registers.php | 16 ++++++++-------- src/Appwrite/Platform/Tasks/Upgrade.php | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/config/collections/common.php b/app/config/collections/common.php index c93310617e..2c80ba9ec7 100644 --- a/app/config/collections/common.php +++ b/app/config/collections/common.php @@ -2055,8 +2055,8 @@ return [ 'filters' => ['topicSearch'], ], ], - // Mongodb do not allow two fulltext indexes on the same field in a single collection - // https://www.mongodb.com/docs/manual/core/indexes/index-types/index-text/text-index-restrictions/ + // Mongodb do not allow two fulltext indexes on the same field in a single collection + // https://www.mongodb.com/docs/manual/core/indexes/index-types/index-text/text-index-restrictions/ 'indexes' => [ // [ // '$id' => ID::custom('_key_name'), diff --git a/app/init/registers.php b/app/init/registers.php index c69c991c8b..daffe3ed82 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -13,10 +13,9 @@ use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Adapter\MariaDB; -use Utopia\Database\Adapter\MySQL; use Utopia\Database\Adapter\Mongo; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Adapter\SQL; -use Utopia\Mongo\Client as MongoClient; use Utopia\Database\PDO; use Utopia\Domains\Validator\PublicDomain; use Utopia\DSN\DSN; @@ -25,6 +24,7 @@ use Utopia\Logger\Adapter\LogOwl; use Utopia\Logger\Adapter\Raygun; use Utopia\Logger\Adapter\Sentry; use Utopia\Logger\Logger; +use Utopia\Mongo\Client as MongoClient; use Utopia\Pools\Group; use Utopia\Pools\Pool; use Utopia\Queue; @@ -196,7 +196,7 @@ $register->set('pools', function () { //throw new Exception(Exception::GENERAL_SERVER_ERROR, "Missing value for DSN connection in {$key}"); continue; } - + $dsn = new DSN($dsn); $dsnHost = $dsn->getHost(); $dsnPort = $dsn->getPort(); @@ -216,7 +216,7 @@ $register->set('pools', function () { * * Resource assignment to an adapter will happen below. */ - + $resource = match ($dsnScheme) { 'mysql', 'mariadb' => function () use ($dsnHost, $dsnPort, $dsnUser, $dsnPass, $dsnDatabase) { @@ -234,7 +234,7 @@ $register->set('pools', function () { try { $mongo = new MongoClient($dsnDatabase, $dsnHost, (int)$dsnPort, $dsnUser, $dsnPass, true); @$mongo->connect(); - + return $mongo; } catch (\Throwable $e) { throw new Exception(Exception::GENERAL_SERVER_ERROR, "MongoDB connection failed: " . $e->getMessage()); @@ -262,7 +262,7 @@ $register->set('pools', function () { 'mysql' => new MySQL($resource()), 'mongodb' => new Mongo($resource()), default => null - }; + }; $adapter->setDatabase($dsn->getPath()); return $adapter; @@ -292,7 +292,7 @@ $register->set('pools', function () { Config::setParam('pools-' . $key, $config); } - + return $group; }); @@ -312,7 +312,7 @@ $register->set('db', function () { try { $mongo = new MongoClient($dbScheme, $dbHost, (int)$dbPort, $dbUser, $dbPass, true); @$mongo->connect(); - + return $mongo; } catch (\Throwable $e) { throw new Exception(Exception::GENERAL_SERVER_ERROR, "MongoDB connection failed: " . $e->getMessage()); diff --git a/src/Appwrite/Platform/Tasks/Upgrade.php b/src/Appwrite/Platform/Tasks/Upgrade.php index 00b6a514bb..327129dfdd 100644 --- a/src/Appwrite/Platform/Tasks/Upgrade.php +++ b/src/Appwrite/Platform/Tasks/Upgrade.php @@ -3,9 +3,9 @@ namespace Appwrite\Platform\Tasks; use Utopia\CLI\Console; +use Utopia\System\System; use Utopia\Validator\Boolean; use Utopia\Validator\Text; -use Utopia\System\System; class Upgrade extends Install {