Skip to content

Commit 749f960

Browse files
committed
migration updates
1 parent 8875fec commit 749f960

File tree

5 files changed

+78
-37
lines changed

5 files changed

+78
-37
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"php": ">=8.0",
1919
"ext-json": "*",
2020
"ext-redis": "*",
21+
"utopia-php/cli": "0.17.*",
2122
"utopia-php/framework": "0.34.*",
22-
"utopia-php/cli": "0.15.*",
23-
"utopia-php/queue": "0.14.*"
23+
"utopia-php/queue": "0.14.*",
24+
"utopia-php/validators": "0.1.*"
2425
},
2526
"require-dev": {
2627
"phpunit/phpunit": "9.*",

composer.lock

Lines changed: 61 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Platform/Platform.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace Utopia\Platform;
44

55
use Exception;
6-
use Utopia\App;
6+
use Utopia\Http\Http;
77
use Utopia\CLI\CLI;
88
use Utopia\Queue\Adapter\Swoole;
99
use Utopia\Queue\Server;
10-
use Utopia\Route;
10+
use Utopia\Http\Route;
1111

1212
abstract class Platform
1313
{
@@ -82,16 +82,16 @@ protected function initHttp(array $services): void
8282
/** @var Action $action */
8383
switch ($action->getType()) {
8484
case Action::TYPE_INIT:
85-
$hook = App::init();
85+
$hook = Http::init();
8686
break;
8787
case Action::TYPE_ERROR:
88-
$hook = App::error();
88+
$hook = Http::error();
8989
break;
9090
case Action::TYPE_OPTIONS:
91-
$hook = App::options();
91+
$hook = Http::options();
9292
break;
9393
case Action::TYPE_SHUTDOWN:
94-
$hook = App::shutdown();
94+
$hook = Http::shutdown();
9595
break;
9696
case Action::TYPE_DEFAULT:
9797
default:
@@ -100,7 +100,7 @@ protected function initHttp(array $services): void
100100
if ($httpMethod === null || $httpPath === null) {
101101
throw new Exception('HTTP method and path must be set for default actions');
102102
}
103-
$hook = App::addRoute($httpMethod, $httpPath);
103+
$hook = Http::addRoute($httpMethod, $httpPath);
104104
break;
105105
}
106106

@@ -125,10 +125,7 @@ protected function initHttp(array $services): void
125125
$option['description'],
126126
$option['optional'],
127127
$option['injections'],
128-
$option['skipValidation'],
129-
$option['deprecated'],
130-
$option['example'],
131-
$option['model'],
128+
$option['skipValidation']
132129
);
133130
break;
134131
case 'injection':

tests/Platform/TestActionInit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Utopia\Tests;
44

55
use Utopia\Platform\Action;
6-
use Utopia\Response;
6+
use Utopia\Http\Response;
77

88
class TestActionInit extends Action
99
{

tests/e2e/server.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
require_once __DIR__.'/../../vendor/autoload.php';
44

5-
use Utopia\App;
6-
use Utopia\Request;
7-
use Utopia\Response;
5+
use Utopia\Http\Adapter\FPM\Server;
6+
use Utopia\Http\Http;
87
use Utopia\Tests\TestPlatform;
98

109
ini_set('memory_limit', '512M');
@@ -16,8 +15,6 @@
1615
$platform = new TestPlatform();
1716
$platform->init('http');
1817

19-
$request = new Request();
20-
$response = new Response();
21-
22-
$app = new App('UTC');
23-
$app->run($request, $response);
18+
$server = new Server();
19+
$http = new Http($server, 'UTC');
20+
$http->start();

0 commit comments

Comments
 (0)