From 86b46353ad514f6403f4632ad9938cb1af4eb7cc Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 22 Apr 2024 22:35:38 +0200 Subject: [PATCH] Fixed for general tests --- app/controllers/api/project.php | 6 +++--- app/controllers/general.php | 8 ++++---- composer.lock | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 05a6c46389..c6ac657d28 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -31,8 +31,8 @@ Http::get('/v1/project/usage') ->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true) ->inject('response') ->inject('dbForProject') - ->inject('auth') - ->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject, Authorization $auth) { + ->inject('authorization') + ->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject, Authorization $authorization) { $stats = $total = $usage = []; $format = 'Y-m-d 00:00:00'; $firstDay = (new DateTime($startDate))->format($format); @@ -71,7 +71,7 @@ Http::get('/v1/project/usage') '1d' => 'Y-m-d\T00:00:00.000P', }; - $auth->skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, &$total, &$stats) { + $authorization->skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, &$total, &$stats) { foreach ($metrics['total'] as $metric) { $result = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), diff --git a/app/controllers/general.php b/app/controllers/general.php index d53be96186..d58efef3dc 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -589,7 +589,6 @@ Http::init() Http::options() ->inject('route') - ->inject('swooleRequest') ->inject('request') ->inject('response') ->inject('dbForConsole') @@ -597,8 +596,8 @@ Http::options() ->inject('queueForEvents') ->inject('queueForUsage') ->inject('geodb') - ->inject('auth') - ->action(function (Route $route, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Reader $geodb, Authorization $auth) { + ->inject('authorization') + ->action(function (Route $route, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Reader $geodb, Authorization $authorization) { /* * Appwrite Router */ @@ -606,7 +605,7 @@ Http::options() $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain if ($host !== $mainDomain) { - if (router($dbForConsole, $getProjectDB, $request, $response, $route, $queueForEvents, $queueForUsage, $geodb, $auth)) { + if (router($dbForConsole, $getProjectDB, $request, $response, $route, $queueForEvents, $queueForUsage, $geodb, $authorization)) { return; } } @@ -898,6 +897,7 @@ include_once 'api/health.php'; include_once 'api/locale.php'; include_once 'api/messaging.php'; //include_once 'api/migrations.php'; +include_once 'api/project.php'; include_once 'api/projects.php'; include_once 'api/proxy.php'; include_once 'api/storage.php'; diff --git a/composer.lock b/composer.lock index 2024225af8..0050b28008 100644 --- a/composer.lock +++ b/composer.lock @@ -1827,12 +1827,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "787b884c306f67b67bd0834b3cabddce1652fd29" + "reference": "db782cedc80a639d1608d6dca7771fcff4031d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/787b884c306f67b67bd0834b3cabddce1652fd29", - "reference": "787b884c306f67b67bd0834b3cabddce1652fd29", + "url": "https://api.github.com/repos/utopia-php/http/zipball/db782cedc80a639d1608d6dca7771fcff4031d88", + "reference": "db782cedc80a639d1608d6dca7771fcff4031d88", "shasum": "" }, "require": { @@ -1869,7 +1869,7 @@ "issues": "https://github.com/utopia-php/http/issues", "source": "https://github.com/utopia-php/http/tree/feat-di-upgrade" }, - "time": "2024-04-22T14:38:43+00:00" + "time": "2024-04-22T20:19:36+00:00" }, { "name": "utopia-php/image",