Skip to content

Commit a64128a

Browse files
loks0nclaude
andcommitted
refactor(clickhouse): inject client, drop hand-rolled transport config, fix phpstan & oversized URLs
Address review feedback: - Make the HTTP transport a constructor param (DI); default to a cURL client with connection reuse. Auth/database move to per-request headers so an injected client stays a pure transport. - Remove setTimeout/setKeepAlive/setMaxRetries/setRetryDelay and the hand-rolled retry engine — these are now the injected client's concern (e.g. Utopia\Client\Decorator\Retry). Trim getConnectionStats accordingly. - Remove setCompression and the gzip Accept-Encoding header. - Send query + param_* as multipart/form-data instead of URL query string, fixing HTTP 414 on large equal/tag filters (restores the pre-migration transport shape ClickHouse parses). - Delete phpstan-baseline.neon and fix all level-max errors (typed decodeRows + guarded scalar coercions); bump composer check memory limit. - Pin Dockerfile base image to php:8.4.22-cli-alpine3.24; add ext-curl to composer suggest. - Widen utopia-php/client constraint to ^0.1|^0.2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6513436 commit a64128a

15 files changed

Lines changed: 257 additions & 1002 deletions

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ COPY composer.json /src/
88
RUN composer install --ignore-platform-reqs --optimize-autoloader \
99
--no-plugins --no-scripts --prefer-dist
1010

11-
FROM php:8.4-cli-alpine as final
11+
FROM php:8.4.22-cli-alpine3.24 as final
1212

1313
LABEL maintainer="team@appwrite.io"
1414

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"scripts": {
1313
"lint": "./vendor/bin/pint --test",
1414
"format": "./vendor/bin/pint",
15-
"check": "./vendor/bin/phpstan analyse -c phpstan.neon",
15+
"check": "./vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=1G",
1616
"test": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite \"Test Suite\"",
1717
"bench": "./vendor/bin/phpunit --configuration phpunit.xml --testsuite Benchmark"
1818
},
1919
"minimum-stability": "stable",
2020
"require": {
2121
"php": ">=8.4",
22-
"utopia-php/client": "^0.1",
22+
"utopia-php/client": "^0.1|^0.2",
2323
"utopia-php/database": "5.*|6.0.*",
2424
"utopia-php/query": "0.1.*"
2525
},
@@ -29,6 +29,9 @@
2929
"phpstan/phpstan": "^2.0",
3030
"laravel/pint": "1.*"
3131
},
32+
"suggest": {
33+
"ext-curl": "Required by the default cURL transport for the ClickHouse adapter. Not needed if you inject a non-cURL utopia-php/client into the adapter."
34+
},
3235
"autoload": {
3336
"psr-4": {
3437
"Utopia\\Usage\\": "src/Usage"

composer.lock

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

phpstan-baseline.neon

Lines changed: 0 additions & 271 deletions
This file was deleted.

phpstan.neon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
includes:
2-
- phpstan-baseline.neon
3-
41
parameters:
52
level: max
63
paths:

0 commit comments

Comments
 (0)