Skip to content

Commit 2b4021b

Browse files
authored
feat: split Swoole adapters, add compression, adopt utopia-php/servers (#230)
* feat: split Swoole adapters, add compression support, and adopt utopia-php/servers - Split Swoole adapter into Swoole (SWOOLE_PROCESS) and SwooleCoroutine (coroutine-based) servers - Add response compression support with configurable min size and algorithm selection - Migrate Hook to utopia-php/servers and Route now extends Servers\Hook - Add View class for template rendering - Add trusted IP header support and IP validation in Request - Enhance Response with cookie management, content-type helpers, and chunked transfer - Add utopia-php/servers and utopia-php/compression dependencies - Fix server-swoole.php test server to work with non-coroutine Swoole adapter - Disable Swoole cookie parsing to preserve raw Cookie headers * fix: address Greptile review comments on PR #230 - Remove Content-Length before re-adding after compression to prevent duplicate headers - Defer onStart callback into coroutine event loop for SwooleCoroutine adapter consistency - Add null-coalescing fallback for preg_replace in View::render - Add void return types to compression setter methods for API consistency * add telemetry
1 parent 15d1195 commit 2b4021b

18 files changed

Lines changed: 2907 additions & 822 deletions

composer.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
],
1111
"license": "MIT",
1212
"minimum-stability": "stable",
13-
"autoload": {
13+
"autoload": {
14+
"psr-4": {
15+
"Utopia\\": "src/"
16+
}
17+
},
18+
"autoload-dev": {
1419
"psr-4": {
15-
"Utopia\\": "src/",
16-
"Tests\\E2E\\": "tests/e2e"
17-
}
18-
},
19-
"autoload-dev": {
20-
"psr-4": {
21-
"Utopia\\Http\\Tests\\": "tests/"
22-
}
23-
},
20+
"Utopia\\Http\\Tests\\": "tests/",
21+
"Tests\\E2E\\": "tests/e2e"
22+
}
23+
},
2424
"scripts": {
2525
"lint": "vendor/bin/pint --test",
2626
"format": "vendor/bin/pint",
@@ -30,9 +30,12 @@
3030
},
3131
"require": {
3232
"php": ">=8.2",
33+
"ext-swoole": "*",
3334
"utopia-php/di": "0.3.*",
34-
"utopia-php/validators": "0.2.*",
35-
"ext-swoole": "*"
35+
"utopia-php/servers": "0.3.*",
36+
"utopia-php/compression": "0.1.*",
37+
"utopia-php/telemetry": "0.2.*",
38+
"utopia-php/validators": "0.2.*"
3639
},
3740
"config": {
3841
"allow-plugins": {

0 commit comments

Comments
 (0)