From 32a24f192aa8d22d6b0699be8291efac0521bb2a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 14 Aug 2026 16:34:37 +1200 Subject: [PATCH 1/9] feat: adapt TimeLimit schema to query-lib Attribute and Index VOs --- composer.json | 13 +- composer.lock | 534 +++++++++++++++++----- src/Abuse/Adapters/TimeLimit/Database.php | 70 +-- 3 files changed, 435 insertions(+), 182 deletions(-) diff --git a/composer.json b/composer.json index a79d771..6523c42 100755 --- a/composer.json +++ b/composer.json @@ -22,10 +22,21 @@ "ext-pdo": "*", "ext-curl": "*", "ext-redis": "*", - "utopia-php/database": "^7.0.0", + "utopia-php/database": "dev-feat-query-lib as 7.0.0", + "utopia-php/query": "0.4.*", "utopia-php/pools": "2.*", "appwrite/appwrite": "^27.1" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/utopia-php/database.git" + }, + { + "type": "vcs", + "url": "https://github.com/utopia-php/async.git" + } + ], "require-dev": { "phpunit/phpunit": "9.*", "phpstan/phpstan": "1.*", diff --git a/composer.lock b/composer.lock index a690369..7dc1a90 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bfae95b93046381a457db8b4f33d5b35", + "content-hash": "aae0e33f82e72e2386b3005a5df36573", "packages": [ { "name": "adhocore/jwt", @@ -248,23 +248,23 @@ }, { "name": "google/protobuf", - "version": "v4.33.6", + "version": "v5.35.1", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "84b008c23915ed94536737eae46f41ba3bccfe67" + "reference": "55bb4a7d6739b5af0927b96213c1371a3afb7cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/84b008c23915ed94536737eae46f41ba3bccfe67", - "reference": "84b008c23915ed94536737eae46f41ba3bccfe67", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/55bb4a7d6739b5af0927b96213c1371a3afb7cfb", + "reference": "55bb4a7d6739b5af0927b96213c1371a3afb7cfb", "shasum": "" }, "require": { - "php": ">=8.1.0" + "php": ">=8.2.0" }, "require-dev": { - "phpunit/phpunit": ">=10.5.62 <11.0.0" + "phpunit/phpunit": ">=11.5.0 <12.0.0" }, "suggest": { "ext-bcmath": "Need to support JSON deserialization" @@ -286,9 +286,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.6" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v5.35.1" }, - "time": "2026-03-18T17:32:05+00:00" + "time": "2026-06-11T21:19:23+00:00" }, { "name": "mongodb/mongodb", @@ -513,16 +513,16 @@ }, { "name": "open-telemetry/api", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "6f8d237ce2c304ca85f31970f788e7f074d147be" + "reference": "7c029c4a6fd457094a20569bf98f93d95e9a7559" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/6f8d237ce2c304ca85f31970f788e7f074d147be", - "reference": "6f8d237ce2c304ca85f31970f788e7f074d147be", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/7c029c4a6fd457094a20569bf98f93d95e9a7559", + "reference": "7c029c4a6fd457094a20569bf98f93d95e9a7559", "shasum": "" }, "require": { @@ -579,7 +579,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2026-02-25T13:24:05+00:00" + "time": "2026-07-06T12:28:04+00:00" }, { "name": "open-telemetry/context", @@ -706,20 +706,20 @@ }, { "name": "open-telemetry/gen-otlp-protobuf", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", - "reference": "a229cf161d42001d64c8f21e8f678581fe1c66b9" + "reference": "66f04d0e448ad333033bfc7baae1aa56330be088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/a229cf161d42001d64c8f21e8f678581fe1c66b9", - "reference": "a229cf161d42001d64c8f21e8f678581fe1c66b9", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66f04d0e448ad333033bfc7baae1aa56330be088", + "reference": "66f04d0e448ad333033bfc7baae1aa56330be088", "shasum": "" }, "require": { - "google/protobuf": "^3.22 || ^4.0", + "google/protobuf": "^3.22 || ^4.0 || ^5.0", "php": "^8.0" }, "suggest": { @@ -765,20 +765,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-10-19T06:44:33+00:00" + "time": "2026-06-17T12:06:32+00:00" }, { "name": "open-telemetry/sdk", - "version": "1.14.0", + "version": "1.15.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "6e3d0ce93e76555dd5e2f1d19443ff45b990e410" + "reference": "77e1aa73850154abb86937d52a70883edc3b4547" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/6e3d0ce93e76555dd5e2f1d19443ff45b990e410", - "reference": "6e3d0ce93e76555dd5e2f1d19443ff45b990e410", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/77e1aa73850154abb86937d52a70883edc3b4547", + "reference": "77e1aa73850154abb86937d52a70883edc3b4547", "shasum": "" }, "require": { @@ -786,7 +786,7 @@ "nyholm/psr7-server": "^1.1", "open-telemetry/api": "^1.8", "open-telemetry/context": "^1.4", - "open-telemetry/sem-conv": "^1.0", + "open-telemetry/sem-conv": "^1.38.0", "php": "^8.1", "php-http/discovery": "^1.14", "psr/http-client": "^1.0", @@ -809,7 +809,10 @@ "spi": { "OpenTelemetry\\API\\Configuration\\ConfigEnv\\EnvComponentLoader": [ "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderHttpConfig", - "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderPeerConfig" + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderPeerConfig", + "OpenTelemetry\\SDK\\ConfigEnv\\Trace\\SpanSuppressionStrategySemConv", + "OpenTelemetry\\SDK\\ConfigEnv\\Trace\\SpanSuppressionStrategySpanKind", + "OpenTelemetry\\SDK\\ConfigEnv\\Distribution\\DistributionConfigurationSdk" ], "OpenTelemetry\\SDK\\Common\\Configuration\\Resolver\\ResolverInterface": [ "OpenTelemetry\\SDK\\Common\\Configuration\\Resolver\\SdkConfigurationResolver" @@ -819,7 +822,7 @@ ] }, "branch-alias": { - "dev-main": "1.12.x-dev" + "dev-main": "1.14.x-dev" } }, "autoload": { @@ -862,7 +865,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2026-03-21T11:50:01+00:00" + "time": "2026-07-14T13:09:54+00:00" }, { "name": "open-telemetry/sem-conv", @@ -921,6 +924,71 @@ }, "time": "2026-01-21T04:14:03+00:00" }, + { + "name": "opis/closure", + "version": "4.5.0", + "source": { + "type": "git", + "url": "https://github.com/opis/closure.git", + "reference": "b97e42b95bb72d87507f5e2d137ceb239aea8d6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/closure/zipball/b97e42b95bb72d87507f5e2d137ceb239aea8d6b", + "reference": "b97e42b95bb72d87507f5e2d137ceb239aea8d6b", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Opis\\Closure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + }, + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + } + ], + "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary data.", + "homepage": "https://opis.io/closure", + "keywords": [ + "anonymous classes", + "anonymous functions", + "closure", + "function", + "serializable", + "serialization", + "serialize" + ], + "support": { + "issues": "https://github.com/opis/closure/issues", + "source": "https://github.com/opis/closure/tree/4.5.0" + }, + "time": "2026-03-05T13:32:42+00:00" + }, { "name": "php-http/discovery", "version": "1.20.0", @@ -1419,16 +1487,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/50f59d1f3ca46d41ac911f97a78626b6756af35b", - "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { @@ -1466,7 +1534,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { @@ -1486,20 +1554,20 @@ "type": "tidelift" } ], - "time": "2026-04-13T15:52:40+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/http-client", - "version": "v7.4.13", + "version": "v7.4.16", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "e8a112b8415707265a7e614278136a9d92989a6a" + "reference": "c513ed0ba5d1784a6b55fc84190dbe4451b12f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/e8a112b8415707265a7e614278136a9d92989a6a", - "reference": "e8a112b8415707265a7e614278136a9d92989a6a", + "url": "https://api.github.com/repos/symfony/http-client/zipball/c513ed0ba5d1784a6b55fc84190dbe4451b12f41", + "reference": "c513ed0ba5d1784a6b55fc84190dbe4451b12f41", "shasum": "" }, "require": { @@ -1567,7 +1635,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.4.13" + "source": "https://github.com/symfony/http-client/tree/v7.4.16" }, "funding": [ { @@ -1587,20 +1655,20 @@ "type": "tidelift" } ], - "time": "2026-05-24T09:57:54+00:00" + "time": "2026-07-29T16:20:51+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "4a2d00c37651c0bdc2b9e1c773487a8bf4edb12d" + "reference": "41fc42d276aeff21192465331ebbab7d83a743c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/4a2d00c37651c0bdc2b9e1c773487a8bf4edb12d", - "reference": "4a2d00c37651c0bdc2b9e1c773487a8bf4edb12d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/41fc42d276aeff21192465331ebbab7d83a743c0", + "reference": "41fc42d276aeff21192465331ebbab7d83a743c0", "shasum": "" }, "require": { @@ -1649,7 +1717,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.7.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.7.1" }, "funding": [ { @@ -1669,7 +1737,7 @@ "type": "tidelift" } ], - "time": "2026-03-06T13:17:50+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1838,16 +1906,16 @@ }, { "name": "symfony/polyfill-php83", - "version": "v1.38.2", + "version": "v1.41.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "796a26abb75ce49f3a84433cd81bf1009d73d5f8" + "reference": "5ea99087fb99c273a9b9236ed4c31e78b16103c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/796a26abb75ce49f3a84433cd81bf1009d73d5f8", - "reference": "796a26abb75ce49f3a84433cd81bf1009d73d5f8", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/5ea99087fb99c273a9b9236ed4c31e78b16103c6", + "reference": "5ea99087fb99c273a9b9236ed4c31e78b16103c6", "shasum": "" }, "require": { @@ -1894,7 +1962,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.38.2" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.41.0" }, "funding": [ { @@ -1914,20 +1982,20 @@ "type": "tidelift" } ], - "time": "2026-05-27T06:51:48+00:00" + "time": "2026-07-01T12:47:55+00:00" }, { "name": "symfony/polyfill-php85", - "version": "v1.38.1", + "version": "v1.41.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php85.git", - "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1" + "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1", - "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/255fab485aaa1006ed411040c42aecd7b5302d7a", + "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a", "shasum": "" }, "require": { @@ -1974,7 +2042,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php85/tree/v1.38.1" + "source": "https://github.com/symfony/polyfill-php85/tree/v1.41.0" }, "funding": [ { @@ -1994,20 +2062,20 @@ "type": "tidelift" } ], - "time": "2026-05-26T02:25:22+00:00" + "time": "2026-07-01T12:47:55+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a" + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d25d82433a80eba6aa0e6c24b61d7370d99e444a", - "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", "shasum": "" }, "require": { @@ -2061,7 +2129,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" }, "funding": [ { @@ -2081,7 +2149,7 @@ "type": "tidelift" } ], - "time": "2026-03-28T09:44:51+00:00" + "time": "2026-06-16T09:55:08+00:00" }, { "name": "tbachert/spi", @@ -2135,35 +2203,152 @@ }, "time": "2025-06-29T15:42:06+00:00" }, + { + "name": "utopia-php/async", + "version": "0.1.1", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/async.git", + "reference": "3ee4fc3d505113d0d6050f35f5bf85e706866a22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/async/zipball/3ee4fc3d505113d0d6050f35f5bf85e706866a22", + "reference": "3ee4fc3d505113d0d6050f35f5bf85e706866a22", + "shasum": "" + }, + "require": { + "opis/closure": "4.*", + "php": ">=8.1" + }, + "require-dev": { + "amphp/amp": "3.*", + "amphp/parallel": "2.*", + "amphp/process": "^2.0", + "laravel/pint": "1.*", + "phpstan/phpstan": "2.*", + "phpunit/phpunit": "11.5.45", + "react/child-process": "0.*", + "react/event-loop": "1.*", + "swoole/ide-helper": "*" + }, + "suggest": { + "amphp/amp": "Required for Amp promise adapter", + "amphp/parallel": "Required for Amp parallel adapter", + "ext-ev": "Required for ReactPHP event loop (recommended for best performance)", + "ext-parallel": "Required for parallel adapter (requires PHP ZTS build)", + "ext-sockets": "Required for Swoole Process adapter", + "ext-swoole": "Required for Swoole Thread and Process adapters (recommended for best performance)", + "react/child-process": "Required for ReactPHP parallel adapter", + "react/event-loop": "Required for ReactPHP promise and parallel adapters" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Async\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Utopia\\Tests\\": "tests/" + } + }, + "scripts": { + "test-unit": [ + "vendor/bin/phpunit tests/Unit --exclude-group no-swoole" + ], + "test-promise-sync": [ + "vendor/bin/phpunit tests/E2e/Promise/SyncTest.php" + ], + "test-promise-swoole": [ + "vendor/bin/phpunit tests/E2e/Promise/Swoole" + ], + "test-promise-amp": [ + "vendor/bin/phpunit tests/E2e/Promise/Amp" + ], + "test-promise-react": [ + "vendor/bin/phpunit tests/E2e/Promise/React" + ], + "test-parallel-sync": [ + "vendor/bin/phpunit tests/E2e/Parallel/Sync" + ], + "test-parallel-swoole-thread": [ + "vendor/bin/phpunit tests/E2e/Parallel/Swoole/ThreadTest.php" + ], + "test-parallel-swoole-process": [ + "vendor/bin/phpunit tests/E2e/Parallel/Swoole/ProcessTest.php" + ], + "test-parallel-amp": [ + "vendor/bin/phpunit tests/E2e/Parallel/Amp" + ], + "test-parallel-react": [ + "vendor/bin/phpunit tests/E2e/Parallel/React" + ], + "test-parallel-ext": [ + "php -n -d extension=parallel.so -d extension=sockets.so vendor/bin/phpunit tests/E2e/Parallel/Parallel" + ], + "test-e2e": [ + "vendor/bin/phpunit tests/E2e --exclude-group ext-parallel" + ], + "test": [ + "@test-unit", + "@test-e2e", + "@test-parallel-ext" + ], + "lint": [ + "vendor/bin/pint" + ], + "format": [ + "php -d memory_limit=4G vendor/bin/pint" + ], + "check": [ + "vendor/bin/phpstan analyse src tests --level=max --memory-limit=4G" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Appwrite Team", + "email": "team@appwrite.io" + } + ], + "description": "High-performance concurrent + parallel library with Promise and Parallel execution support for PHP.", + "support": { + "source": "https://github.com/utopia-php/async/tree/0.1.1", + "issues": "https://github.com/utopia-php/async/issues" + }, + "time": "2026-06-08T05:10:34+00:00" + }, { "name": "utopia-php/cache", - "version": "4.0.0", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "2ab50440114a7699b8a017ee2ecd8bcd9d54ac5e" + "reference": "92e02dab63606234b993b841ebf4c58845dd4620" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/2ab50440114a7699b8a017ee2ecd8bcd9d54ac5e", - "reference": "2ab50440114a7699b8a017ee2ecd8bcd9d54ac5e", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/92e02dab63606234b993b841ebf4c58845dd4620", + "reference": "92e02dab63606234b993b841ebf4c58845dd4620", "shasum": "" }, "require": { "ext-json": "*", - "ext-memcached": "*", - "ext-redis": "*", - "php": ">=8.3", - "utopia-php/circuit-breaker": "0.3.*", - "utopia-php/pools": "2.*", - "utopia-php/telemetry": "*" + "php": ">=8.4", + "utopia-php/circuit-breaker": "^0.3", + "utopia-php/pools": "^2.0", + "utopia-php/telemetry": "^0.4" }, "require-dev": { - "laravel/pint": "1.2.*", - "phpstan/phpstan": "^1.12", - "phpunit/phpunit": "^9.3", - "swoole/ide-helper": "^6.0", - "vimeo/psalm": "4.13.1" + "swoole/ide-helper": "^6.0" + }, + "suggest": { + "ext-memcached": "Required for the Memcached and Hazelcast adapters.", + "ext-redis": "Required for the Redis, RedisCluster and Sharding adapters.", + "ext-swoole": "Required for the multiplexing Redis adapter (>=6.0)." }, "type": "library", "autoload": { @@ -2175,6 +2360,12 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Team Appwrite", + "email": "team@appwrite.io" + } + ], "description": "A simple cache library to manage application cache storing, loading and purging", "keywords": [ "cache", @@ -2185,32 +2376,29 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/4.0.0" + "source": "https://github.com/utopia-php/cache/tree/4.0.2" }, - "time": "2026-07-31T13:04:45+00:00" + "time": "2026-08-12T07:48:59+00:00" }, { "name": "utopia-php/circuit-breaker", - "version": "0.3.1", + "version": "0.3.2", "source": { "type": "git", "url": "https://github.com/utopia-php/circuit-breaker.git", - "reference": "db5d77f6c99ebce2ee81bd8ed4ae8f41bd2b0828" + "reference": "5fbc3802471b0d1b4260bd9f5544514e6929b481" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/circuit-breaker/zipball/db5d77f6c99ebce2ee81bd8ed4ae8f41bd2b0828", - "reference": "db5d77f6c99ebce2ee81bd8ed4ae8f41bd2b0828", + "url": "https://api.github.com/repos/utopia-php/circuit-breaker/zipball/5fbc3802471b0d1b4260bd9f5544514e6929b481", + "reference": "5fbc3802471b0d1b4260bd9f5544514e6929b481", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "laravel/pint": "^1.29", - "phpstan/phpstan": "^2.1", - "phpunit/phpunit": "^10.0", - "utopia-php/telemetry": "^0.4" + "utopia-php/telemetry": "^0.4.6" }, "suggest": { "ext-opentelemetry": "Required by utopia-php/telemetry when using OpenTelemetry metrics.", @@ -2222,7 +2410,7 @@ "type": "library", "autoload": { "psr-4": { - "Utopia\\CircuitBreaker\\": "src/CircuitBreaker" + "Utopia\\CircuitBreaker\\": "src/CircuitBreaker/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2247,9 +2435,9 @@ ], "support": { "issues": "https://github.com/utopia-php/circuit-breaker/issues", - "source": "https://github.com/utopia-php/circuit-breaker/tree/0.3.1" + "source": "https://github.com/utopia-php/circuit-breaker/tree/0.3.2" }, - "time": "2026-05-29T12:12:23+00:00" + "time": "2026-08-05T18:07:20+00:00" }, { "name": "utopia-php/console", @@ -2301,16 +2489,16 @@ }, { "name": "utopia-php/database", - "version": "7.0.0", + "version": "dev-feat-query-lib", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "40185b100f92c402a189d6f4f0962c63bbe5726b" + "reference": "e593b78c587e1f1d66b644979f5c4ff11dffcd31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/40185b100f92c402a189d6f4f0962c63bbe5726b", - "reference": "40185b100f92c402a189d6f4f0962c63bbe5726b", + "url": "https://api.github.com/repos/utopia-php/database/zipball/e593b78c587e1f1d66b644979f5c4ff11dffcd31", + "reference": "e593b78c587e1f1d66b644979f5c4ff11dffcd31", "shasum": "" }, "require": { @@ -2319,29 +2507,67 @@ "ext-pdo": "*", "ext-redis": "*", "php": ">=8.5", - "utopia-php/cache": "^4.0.0", + "utopia-php/async": "0.1.*", + "utopia-php/cache": "4.*", "utopia-php/console": "0.1.*", "utopia-php/mongo": "1.*", "utopia-php/pools": "2.*", - "utopia-php/validators": "0.3.*" + "utopia-php/query": "0.4.*", + "utopia-php/validators": "0.4.*" }, "require-dev": { + "brianium/paratest": "7.20.*", "fakerphp/faker": "1.23.*", "laravel/pint": "*", - "pcov/clobber": "2.*", - "phpstan/phpstan": "1.*", - "phpunit/phpunit": "9.*", + "phpstan/phpstan": "2.1.*", + "phpunit/phpunit": "12.5.*", "rregeer/phpunit-coverage-check": "0.3.*", "swoole/ide-helper": "5.1.3", "utopia-php/cli": "0.22.*" }, + "suggest": { + "ext-pdo": "Needed to support MariaDB, MySQL or SQLite Database Adapter", + "ext-redis": "Needed to support Redis Cache Adapter", + "mongodb/mongodb": "Needed to support MongoDB Database Adapter" + }, "type": "library", "autoload": { "psr-4": { "Utopia\\Database\\": "src/Database" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Tests\\E2E\\": "tests/e2e", + "Tests\\Unit\\": "tests/unit" + } + }, + "scripts": { + "build": [ + "Composer\\Config::disableProcessTimeout", + "docker compose build" + ], + "start": [ + "Composer\\Config::disableProcessTimeout", + "docker compose up -d" + ], + "test": [ + "Composer\\Config::disableProcessTimeout", + "docker compose exec tests vendor/bin/paratest --configuration phpunit.xml --functional --processes 4" + ], + "lint": [ + "php -d memory_limit=2G ./vendor/bin/pint --test" + ], + "format": [ + "php -d memory_limit=2G ./vendor/bin/pint" + ], + "check": [ + "./vendor/bin/phpstan analyse --memory-limit 2G" + ], + "coverage": [ + "./vendor/bin/coverage-check ./tmp/clover.xml 90" + ] + }, "license": [ "MIT" ], @@ -2354,23 +2580,23 @@ "utopia" ], "support": { - "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/7.0.0" + "source": "https://github.com/utopia-php/database/tree/feat-query-lib", + "issues": "https://github.com/utopia-php/database/issues" }, - "time": "2026-07-31T13:33:10+00:00" + "time": "2026-08-14T02:54:13+00:00" }, { "name": "utopia-php/mongo", - "version": "1.4.0", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/utopia-php/mongo.git", - "reference": "78818fd295f2829aaad5b74c9094e8c6f603550d" + "reference": "be29ee2d84b9f7efdfc6fea5b4b2d4bf95ff5ec4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/mongo/zipball/78818fd295f2829aaad5b74c9094e8c6f603550d", - "reference": "78818fd295f2829aaad5b74c9094e8c6f603550d", + "url": "https://api.github.com/repos/utopia-php/mongo/zipball/be29ee2d84b9f7efdfc6fea5b4b2d4bf95ff5ec4", + "reference": "be29ee2d84b9f7efdfc6fea5b4b2d4bf95ff5ec4", "shasum": "" }, "require": { @@ -2416,9 +2642,9 @@ ], "support": { "issues": "https://github.com/utopia-php/mongo/issues", - "source": "https://github.com/utopia-php/mongo/tree/1.4.0" + "source": "https://github.com/utopia-php/mongo/tree/1.5.3" }, - "time": "2026-07-30T05:24:58+00:00" + "time": "2026-08-13T01:55:11+00:00" }, { "name": "utopia-php/pools", @@ -2476,18 +2702,67 @@ }, "time": "2026-07-31T12:19:18+00:00" }, + { + "name": "utopia-php/query", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/query.git", + "reference": "c334515035a2ab0aa49176eeca96de3e1c096e22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/query/zipball/c334515035a2ab0aa49176eeca96de3e1c096e22", + "reference": "c334515035a2ab0aa49176eeca96de3e1c096e22", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "brianium/paratest": "*", + "laravel/pint": "*", + "mongodb/mongodb": "^2.0", + "phpstan/phpstan": "*", + "phpunit/phpcov": "*", + "phpunit/phpunit": "^12.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Query\\": "src/Query" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A simple library providing a query abstraction for filtering, ordering, and pagination", + "keywords": [ + "framework", + "php", + "query", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/query/issues", + "source": "https://github.com/utopia-php/query/tree/0.4.0" + }, + "time": "2026-08-14T01:42:36+00:00" + }, { "name": "utopia-php/telemetry", - "version": "0.4.5", + "version": "0.4.6", "source": { "type": "git", "url": "https://github.com/utopia-php/telemetry.git", - "reference": "139943bffcd4f6dd8fb9ed247f946a1d151b006a" + "reference": "f96778a01792c32df0876fe1f38a79b9588445d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/139943bffcd4f6dd8fb9ed247f946a1d151b006a", - "reference": "139943bffcd4f6dd8fb9ed247f946a1d151b006a", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/f96778a01792c32df0876fe1f38a79b9588445d8", + "reference": "f96778a01792c32df0876fe1f38a79b9588445d8", "shasum": "" }, "require": { @@ -2523,22 +2798,22 @@ ], "support": { "issues": "https://github.com/utopia-php/telemetry/issues", - "source": "https://github.com/utopia-php/telemetry/tree/0.4.5" + "source": "https://github.com/utopia-php/telemetry/tree/0.4.6" }, - "time": "2026-07-08T11:07:25+00:00" + "time": "2026-08-05T17:56:48+00:00" }, { "name": "utopia-php/validators", - "version": "0.3.1", + "version": "0.4.2", "source": { "type": "git", "url": "https://github.com/utopia-php/validators.git", - "reference": "d9c2269ebd2596a09681ccd2fd133eeedfcdf9ba" + "reference": "a5b7b78b789e5af0a30f96da8355bbf48fb56699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/validators/zipball/d9c2269ebd2596a09681ccd2fd133eeedfcdf9ba", - "reference": "d9c2269ebd2596a09681ccd2fd133eeedfcdf9ba", + "url": "https://api.github.com/repos/utopia-php/validators/zipball/a5b7b78b789e5af0a30f96da8355bbf48fb56699", + "reference": "a5b7b78b789e5af0a30f96da8355bbf48fb56699", "shasum": "" }, "require": { @@ -2563,9 +2838,9 @@ ], "support": { "issues": "https://github.com/utopia-php/validators/issues", - "source": "https://github.com/utopia-php/validators/tree/0.3.1" + "source": "https://github.com/utopia-php/validators/tree/0.4.2" }, - "time": "2026-07-14T11:55:48+00:00" + "time": "2026-08-11T07:43:49+00:00" } ], "packages-dev": [ @@ -5668,9 +5943,18 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-feat-query-lib", + "alias": "7.0.0", + "alias_normalized": "7.0.0.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Abuse/Adapters/TimeLimit/Database.php b/src/Abuse/Adapters/TimeLimit/Database.php index cf9c30c..92d10c6 100644 --- a/src/Abuse/Adapters/TimeLimit/Database.php +++ b/src/Abuse/Adapters/TimeLimit/Database.php @@ -3,62 +3,22 @@ namespace Utopia\Abuse\Adapters\TimeLimit; use Utopia\Abuse\Adapters\TimeLimit; +use Utopia\Database\Attribute; use Utopia\Database\Database as UtopiaDB; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Exception\Structure; +use Utopia\Database\Index; use Utopia\Database\Query; +use Utopia\Query\Schema\ColumnType; +use Utopia\Query\Schema\IndexType; class Database extends TimeLimit { public const COLLECTION = 'abuse'; - public const ATTRIBUTES = [ - [ - '$id' => 'key', - 'type' => UtopiaDB::VAR_STRING, - 'size' => UtopiaDB::LENGTH_KEY, - 'required' => true, - 'signed' => true, - 'array' => false, - 'filters' => [], - ], [ - '$id' => 'time', - 'type' => UtopiaDB::VAR_DATETIME, - 'size' => 0, - 'required' => true, - 'signed' => false, - 'array' => false, - 'filters' => ['datetime'], - ], [ - '$id' => 'count', - 'type' => UtopiaDB::VAR_INTEGER, - 'size' => 11, - 'required' => true, - 'signed' => false, - 'array' => false, - 'filters' => [], - ], - ]; - - public const INDEXES = [ - [ - '$id' => 'unique1', - 'type' => UtopiaDB::INDEX_UNIQUE, - 'attributes' => ['key', 'time'], - 'lengths' => [], - 'orders' => [], - ], [ - '$id' => 'index2', - 'type' => UtopiaDB::INDEX_KEY, - 'attributes' => ['time'], - 'lengths' => [], - 'orders' => [], - ], - ]; - /** * @var UtopiaDB */ @@ -94,20 +54,18 @@ public function setup(): void throw new \Exception('You need to create database before running timelimit setup'); } - $attributes = \array_map(function ($attribute) { - return new Document($attribute); - }, self::ATTRIBUTES); - - $indexes = \array_map(function ($index) { - return new Document($index); - }, self::INDEXES); + $attributes = [ + new Attribute(key: 'key', type: ColumnType::String, size: UtopiaDB::LENGTH_KEY, required: true, signed: true, array: false, filters: []), + new Attribute(key: 'time', type: ColumnType::Datetime, size: 0, required: true, signed: false, array: false, filters: ['datetime']), + new Attribute(key: 'count', type: ColumnType::Integer, size: 11, required: true, signed: false, array: false, filters: []), + ]; + $indexes = [ + new Index(key: 'unique1', type: IndexType::Unique, attributes: ['key', 'time']), + new Index(key: 'index2', type: IndexType::Key, attributes: ['time']), + ]; try { - $this->db->createCollection( - self::COLLECTION, - $attributes, - $indexes - ); + $this->db->createCollection(self::COLLECTION, $attributes, $indexes); } catch (Duplicate) { // Collection already exists } From cfbd5fecef48f5114d12d6f4a591e3a1a587a7fc Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Aug 2026 16:10:17 +1200 Subject: [PATCH 2/9] chore: require PHP 8.5 to match query-lib database utopia-php/database feat-query-lib (and Appwrite/Cloud) require PHP >=8.5. Advertising >=8.4.1 made Composer reject the graph for 8.4 consumers while CI only passed 8.4 via ignore-platform-reqs. --- .github/workflows/tests.yml | 2 +- Dockerfile.php-8.4 | 27 --------------------------- composer.json | 2 +- composer.lock | 4 ++-- docker-compose.yml | 2 +- 5 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 Dockerfile.php-8.4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fec77ce..9dea7de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.4', '8.5'] + php-versions: ['8.5'] steps: - name: Checkout repository diff --git a/Dockerfile.php-8.4 b/Dockerfile.php-8.4 deleted file mode 100644 index 8e929fb..0000000 --- a/Dockerfile.php-8.4 +++ /dev/null @@ -1,27 +0,0 @@ -FROM composer:2.0 as step0 - -WORKDIR /src/ - -COPY composer.lock /src/ -COPY composer.json /src/ - -RUN composer install --ignore-platform-reqs --optimize-autoloader \ - --no-plugins --no-scripts --prefer-dist - -FROM appwrite/utopia-base:php-8.4-1.0.0 as final - -LABEL maintainer="team@appwrite.io" - -RUN docker-php-ext-install pdo_mysql - -WORKDIR /code - -COPY --from=step0 /src/vendor /code/vendor - -# Add Source Code -COPY ./tests /code/tests -COPY ./src /code/src -COPY ./phpunit.xml /code/phpunit.xml -COPY ./phpbench.json /code/phpbench.json - -CMD [ "tail", "-f", "/dev/null" ] diff --git a/composer.json b/composer.json index 6523c42..b959343 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "bench": "vendor/bin/phpbench run --report=aggregate" }, "require": { - "php": ">=8.4.1", + "php": ">=8.5", "ext-pdo": "*", "ext-curl": "*", "ext-redis": "*", diff --git a/composer.lock b/composer.lock index 7dc1a90..601b20a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "aae0e33f82e72e2386b3005a5df36573", + "content-hash": "ed8902c2e03a95d2a5f6a87d174dfa67", "packages": [ { "name": "adhocore/jwt", @@ -5958,7 +5958,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.4.1", + "php": ">=8.5", "ext-pdo": "*", "ext-curl": "*", "ext-redis": "*" diff --git a/docker-compose.yml b/docker-compose.yml index 8583a6c..e7088e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: tests: build: context: . - dockerfile: Dockerfile.php-${PHP_VERSION:-8.4} + dockerfile: Dockerfile.php-${PHP_VERSION:-8.5} networks: - abuse depends_on: From 05cce876b6b0d6a468bf8b2934f784514a6cccb4 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Aug 2026 16:48:39 +1200 Subject: [PATCH 3/9] (refactor): prefer Attribute and Index typed factories Schema setup with a known column or index type now uses Attribute::string() / Index::key() instead of the generic constructors plus ColumnType / IndexType. --- src/Abuse/Adapters/TimeLimit/Database.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Abuse/Adapters/TimeLimit/Database.php b/src/Abuse/Adapters/TimeLimit/Database.php index 92d10c6..81c3ef9 100644 --- a/src/Abuse/Adapters/TimeLimit/Database.php +++ b/src/Abuse/Adapters/TimeLimit/Database.php @@ -12,8 +12,6 @@ use Utopia\Database\Exception\Structure; use Utopia\Database\Index; use Utopia\Database\Query; -use Utopia\Query\Schema\ColumnType; -use Utopia\Query\Schema\IndexType; class Database extends TimeLimit { @@ -55,13 +53,13 @@ public function setup(): void } $attributes = [ - new Attribute(key: 'key', type: ColumnType::String, size: UtopiaDB::LENGTH_KEY, required: true, signed: true, array: false, filters: []), - new Attribute(key: 'time', type: ColumnType::Datetime, size: 0, required: true, signed: false, array: false, filters: ['datetime']), - new Attribute(key: 'count', type: ColumnType::Integer, size: 11, required: true, signed: false, array: false, filters: []), + Attribute::string(key: 'key', size: UtopiaDB::LENGTH_KEY, required: true), + Attribute::datetime(key: 'time', required: true, signed: false, filters: ['datetime']), + Attribute::integer(key: 'count', size: 11, required: true, signed: false), ]; $indexes = [ - new Index(key: 'unique1', type: IndexType::Unique, attributes: ['key', 'time']), - new Index(key: 'index2', type: IndexType::Key, attributes: ['time']), + Index::unique(key: 'unique1', attributes: ['key', 'time']), + Index::key(key: 'index2', attributes: ['time']), ]; try { From 959a1b398e401ebe79ed5faaaad8fd31fba39516 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Aug 2026 17:11:32 +1200 Subject: [PATCH 4/9] (chore): use caret ranges for Utopia dependencies Asterisk wildcards on utopia-php packages are replaced with equivalent caret constraints so Composer ranges stay consistent. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b959343..87ad719 100755 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "ext-curl": "*", "ext-redis": "*", "utopia-php/database": "dev-feat-query-lib as 7.0.0", - "utopia-php/query": "0.4.*", - "utopia-php/pools": "2.*", + "utopia-php/query": "^0.4", + "utopia-php/pools": "^2.0", "appwrite/appwrite": "^27.1" }, "repositories": [ From 99414ffd5d848be8d61a57edef80784a2b02d704 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Aug 2026 17:23:25 +1200 Subject: [PATCH 5/9] (chore): refresh lockfile after caret Utopia constraints Keep composer.json and composer.lock in sync so `composer validate` passes, and pin utopia-php/database to the current query-lib HEAD. --- composer.lock | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/composer.lock b/composer.lock index 601b20a..8574898 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ed8902c2e03a95d2a5f6a87d174dfa67", + "content-hash": "4cd2d86b645fa86705bc5efde4f815df", "packages": [ { "name": "adhocore/jwt", @@ -248,23 +248,23 @@ }, { "name": "google/protobuf", - "version": "v5.35.1", + "version": "v5.36.0", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "55bb4a7d6739b5af0927b96213c1371a3afb7cfb" + "reference": "9c105104b54709ecd902494ab340ed2122789b2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/55bb4a7d6739b5af0927b96213c1371a3afb7cfb", - "reference": "55bb4a7d6739b5af0927b96213c1371a3afb7cfb", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/9c105104b54709ecd902494ab340ed2122789b2d", + "reference": "9c105104b54709ecd902494ab340ed2122789b2d", "shasum": "" }, "require": { "php": ">=8.2.0" }, "require-dev": { - "phpunit/phpunit": ">=11.5.0 <12.0.0" + "phpunit/phpunit": ">=11.5.50 <12.0.0" }, "suggest": { "ext-bcmath": "Need to support JSON deserialization" @@ -286,9 +286,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v5.35.1" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v5.36.0" }, - "time": "2026-06-11T21:19:23+00:00" + "time": "2026-08-20T13:06:50+00:00" }, { "name": "mongodb/mongodb", @@ -2493,12 +2493,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "e593b78c587e1f1d66b644979f5c4ff11dffcd31" + "reference": "798f294c1615102c92f8e8f7f8b3d18f36ad083b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/e593b78c587e1f1d66b644979f5c4ff11dffcd31", - "reference": "e593b78c587e1f1d66b644979f5c4ff11dffcd31", + "url": "https://api.github.com/repos/utopia-php/database/zipball/798f294c1615102c92f8e8f7f8b3d18f36ad083b", + "reference": "798f294c1615102c92f8e8f7f8b3d18f36ad083b", "shasum": "" }, "require": { @@ -2507,13 +2507,13 @@ "ext-pdo": "*", "ext-redis": "*", "php": ">=8.5", - "utopia-php/async": "0.1.*", - "utopia-php/cache": "4.*", - "utopia-php/console": "0.1.*", - "utopia-php/mongo": "1.*", - "utopia-php/pools": "2.*", - "utopia-php/query": "0.4.*", - "utopia-php/validators": "0.4.*" + "utopia-php/async": "^0.1", + "utopia-php/cache": "^4.0", + "utopia-php/console": "^0.1", + "utopia-php/mongo": "^1.0", + "utopia-php/pools": "^2.0", + "utopia-php/query": "^0.4", + "utopia-php/validators": "^0.4 || ^0.5" }, "require-dev": { "brianium/paratest": "7.20.*", @@ -2523,7 +2523,7 @@ "phpunit/phpunit": "12.5.*", "rregeer/phpunit-coverage-check": "0.3.*", "swoole/ide-helper": "5.1.3", - "utopia-php/cli": "0.22.*" + "utopia-php/cli": "^0.22" }, "suggest": { "ext-pdo": "Needed to support MariaDB, MySQL or SQLite Database Adapter", @@ -2583,7 +2583,7 @@ "source": "https://github.com/utopia-php/database/tree/feat-query-lib", "issues": "https://github.com/utopia-php/database/issues" }, - "time": "2026-08-14T02:54:13+00:00" + "time": "2026-08-21T05:22:01+00:00" }, { "name": "utopia-php/mongo", @@ -2804,16 +2804,16 @@ }, { "name": "utopia-php/validators", - "version": "0.4.2", + "version": "0.5.0", "source": { "type": "git", "url": "https://github.com/utopia-php/validators.git", - "reference": "a5b7b78b789e5af0a30f96da8355bbf48fb56699" + "reference": "ea6c1ad13019c8a088866cf422c232928de5a25e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/validators/zipball/a5b7b78b789e5af0a30f96da8355bbf48fb56699", - "reference": "a5b7b78b789e5af0a30f96da8355bbf48fb56699", + "url": "https://api.github.com/repos/utopia-php/validators/zipball/ea6c1ad13019c8a088866cf422c232928de5a25e", + "reference": "ea6c1ad13019c8a088866cf422c232928de5a25e", "shasum": "" }, "require": { @@ -2838,9 +2838,9 @@ ], "support": { "issues": "https://github.com/utopia-php/validators/issues", - "source": "https://github.com/utopia-php/validators/tree/0.4.2" + "source": "https://github.com/utopia-php/validators/tree/0.5.0" }, - "time": "2026-08-11T07:43:49+00:00" + "time": "2026-08-14T05:12:07+00:00" } ], "packages-dev": [ From ae8399d51e23d71eb8114cb18c2e676fd215aa5f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Aug 2026 18:52:50 +1200 Subject: [PATCH 6/9] (feat): pass Collection to createCollection Database::createCollection no longer accepts a string id. --- composer.lock | 8 ++++---- src/Abuse/Adapters/TimeLimit/Database.php | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 8574898..fd9b5d8 100644 --- a/composer.lock +++ b/composer.lock @@ -2493,12 +2493,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "798f294c1615102c92f8e8f7f8b3d18f36ad083b" + "reference": "808f90bff1a7ccec78cc2eabebd30c2454a9c896" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/798f294c1615102c92f8e8f7f8b3d18f36ad083b", - "reference": "798f294c1615102c92f8e8f7f8b3d18f36ad083b", + "url": "https://api.github.com/repos/utopia-php/database/zipball/808f90bff1a7ccec78cc2eabebd30c2454a9c896", + "reference": "808f90bff1a7ccec78cc2eabebd30c2454a9c896", "shasum": "" }, "require": { @@ -2583,7 +2583,7 @@ "source": "https://github.com/utopia-php/database/tree/feat-query-lib", "issues": "https://github.com/utopia-php/database/issues" }, - "time": "2026-08-21T05:22:01+00:00" + "time": "2026-08-21T06:50:33+00:00" }, { "name": "utopia-php/mongo", diff --git a/src/Abuse/Adapters/TimeLimit/Database.php b/src/Abuse/Adapters/TimeLimit/Database.php index 81c3ef9..2f1101a 100644 --- a/src/Abuse/Adapters/TimeLimit/Database.php +++ b/src/Abuse/Adapters/TimeLimit/Database.php @@ -4,6 +4,7 @@ use Utopia\Abuse\Adapters\TimeLimit; use Utopia\Database\Attribute; +use Utopia\Database\Collection; use Utopia\Database\Database as UtopiaDB; use Utopia\Database\DateTime; use Utopia\Database\Document; @@ -63,7 +64,7 @@ public function setup(): void ]; try { - $this->db->createCollection(self::COLLECTION, $attributes, $indexes); + $this->db->createCollection(new Collection(id: self::COLLECTION, attributes: $attributes, indexes: $indexes)); } catch (Duplicate) { // Collection already exists } From 3b710d480808a3b5fe36324c7956e4c003a63967 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 21 Aug 2026 19:18:02 +1200 Subject: [PATCH 7/9] (chore): allow utopia-php/query 0.5 Database feat-query-lib now requires query ^0.5 after nested joins. --- composer.json | 2 +- composer.lock | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index 87ad719..892f221 100755 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "ext-curl": "*", "ext-redis": "*", "utopia-php/database": "dev-feat-query-lib as 7.0.0", - "utopia-php/query": "^0.4", + "utopia-php/query": "^0.4 || ^0.5", "utopia-php/pools": "^2.0", "appwrite/appwrite": "^27.1" }, diff --git a/composer.lock b/composer.lock index fd9b5d8..242f7f7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4cd2d86b645fa86705bc5efde4f815df", + "content-hash": "a16db69006f7f709588fe071043e18a5", "packages": [ { "name": "adhocore/jwt", @@ -2493,12 +2493,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "808f90bff1a7ccec78cc2eabebd30c2454a9c896" + "reference": "63bd77d0735a81280d99a9e6960bb36ecd1c902e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/808f90bff1a7ccec78cc2eabebd30c2454a9c896", - "reference": "808f90bff1a7ccec78cc2eabebd30c2454a9c896", + "url": "https://api.github.com/repos/utopia-php/database/zipball/63bd77d0735a81280d99a9e6960bb36ecd1c902e", + "reference": "63bd77d0735a81280d99a9e6960bb36ecd1c902e", "shasum": "" }, "require": { @@ -2512,7 +2512,7 @@ "utopia-php/console": "^0.1", "utopia-php/mongo": "^1.0", "utopia-php/pools": "^2.0", - "utopia-php/query": "^0.4", + "utopia-php/query": "^0.5", "utopia-php/validators": "^0.4 || ^0.5" }, "require-dev": { @@ -2583,7 +2583,7 @@ "source": "https://github.com/utopia-php/database/tree/feat-query-lib", "issues": "https://github.com/utopia-php/database/issues" }, - "time": "2026-08-21T06:50:33+00:00" + "time": "2026-08-21T07:15:17+00:00" }, { "name": "utopia-php/mongo", @@ -2648,21 +2648,21 @@ }, { "name": "utopia-php/pools", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "48905dac1b8f8050c2e07bdda32a018ca33982fc" + "reference": "86d43fcacd125232c0743e8c22695faf97285cf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/48905dac1b8f8050c2e07bdda32a018ca33982fc", - "reference": "48905dac1b8f8050c2e07bdda32a018ca33982fc", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/86d43fcacd125232c0743e8c22695faf97285cf3", + "reference": "86d43fcacd125232c0743e8c22695faf97285cf3", "shasum": "" }, "require": { "php": ">=8.4", - "utopia-php/telemetry": "^0.4" + "utopia-php/telemetry": "^0.4.6" }, "require-dev": { "swoole/ide-helper": "6.*" @@ -2698,22 +2698,22 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/2.0.1" + "source": "https://github.com/utopia-php/pools/tree/2.0.2" }, - "time": "2026-07-31T12:19:18+00:00" + "time": "2026-08-05T18:07:20+00:00" }, { "name": "utopia-php/query", - "version": "0.4.0", + "version": "0.5.0", "source": { "type": "git", "url": "https://github.com/utopia-php/query.git", - "reference": "c334515035a2ab0aa49176eeca96de3e1c096e22" + "reference": "802821c6fb0470410e1f0e65561cc16224c343c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/query/zipball/c334515035a2ab0aa49176eeca96de3e1c096e22", - "reference": "c334515035a2ab0aa49176eeca96de3e1c096e22", + "url": "https://api.github.com/repos/utopia-php/query/zipball/802821c6fb0470410e1f0e65561cc16224c343c0", + "reference": "802821c6fb0470410e1f0e65561cc16224c343c0", "shasum": "" }, "require": { @@ -2747,9 +2747,9 @@ ], "support": { "issues": "https://github.com/utopia-php/query/issues", - "source": "https://github.com/utopia-php/query/tree/0.4.0" + "source": "https://github.com/utopia-php/query/tree/0.5.0" }, - "time": "2026-08-14T01:42:36+00:00" + "time": "2026-08-21T06:16:10+00:00" }, { "name": "utopia-php/telemetry", From d50077b1edfb9871f6ce5024742e8097cc72541f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 26 Aug 2026 19:47:27 +1200 Subject: [PATCH 8/9] chore(deps): allow utopia-php/query 0.6 The branch requires query "^0.4 || ^0.5" while the database branch it depends on moved to "0.6.*". Composer cannot satisfy both, and audit's branch is on 0.6 as well, so anything requiring abuse and audit together -- appwrite does -- cannot resolve either. CI has not been showing this because the committed lock still pins a database commit from before that bump, so nothing has re-resolved. Running composer update against the current branch head fails outright: utopia-php/database dev-feat-query-lib requires utopia-php/query 0.6.* -> found utopia-php/query[0.6.0] but it conflicts with your root composer.json require (^0.4 || ^0.5). The lock now tracks the database branch head rather than a commit two constraint changes behind it. Nothing in src or tests touches the parts of the query API that changed between 0.5 and 0.6. phpstan at level max and pint are both clean, and the suite returns exactly the same counts before and after the bump on the same containers -- 113 tests, 54 errors, 2 failures, 39 skipped, all of them the uninitialised local redis cluster rather than anything this changes. Co-Authored-By: Claude Opus 5 --- composer.json | 18 ++++++++++--- composer.lock | 73 ++++++++++++++++++++++++++------------------------- 2 files changed, 51 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index 892f221..e979e4e 100755 --- a/composer.json +++ b/composer.json @@ -2,14 +2,24 @@ "name": "utopia-php/abuse", "description": "A simple abuse library to manage application usage limits", "type": "library", - "keywords": ["php","framework", "upf", "utopia", "abuse"], + "keywords": [ + "php", + "framework", + "upf", + "utopia", + "abuse" + ], "license": "MIT", "minimum-stability": "stable", "autoload": { - "psr-4": {"Utopia\\Abuse\\": "src/Abuse"} + "psr-4": { + "Utopia\\Abuse\\": "src/Abuse" + } }, "autoload-dev": { - "psr-4": {"Utopia\\Tests\\": "tests/Abuse"} + "psr-4": { + "Utopia\\Tests\\": "tests/Abuse" + } }, "scripts": { "check": "./vendor/bin/phpstan analyse --level max --memory-limit=2G src tests", @@ -23,7 +33,7 @@ "ext-curl": "*", "ext-redis": "*", "utopia-php/database": "dev-feat-query-lib as 7.0.0", - "utopia-php/query": "^0.4 || ^0.5", + "utopia-php/query": "0.6.*", "utopia-php/pools": "^2.0", "appwrite/appwrite": "^27.1" }, diff --git a/composer.lock b/composer.lock index 242f7f7..4278a4c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a16db69006f7f709588fe071043e18a5", + "content-hash": "a4ba10d06ea0de76bce5232d19aa3833", "packages": [ { "name": "adhocore/jwt", @@ -1558,16 +1558,16 @@ }, { "name": "symfony/http-client", - "version": "v7.4.16", + "version": "v7.4.17", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "c513ed0ba5d1784a6b55fc84190dbe4451b12f41" + "reference": "d0aca330a822fe40376cd04c335cb48a24743d0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/c513ed0ba5d1784a6b55fc84190dbe4451b12f41", - "reference": "c513ed0ba5d1784a6b55fc84190dbe4451b12f41", + "url": "https://api.github.com/repos/symfony/http-client/zipball/d0aca330a822fe40376cd04c335cb48a24743d0c", + "reference": "d0aca330a822fe40376cd04c335cb48a24743d0c", "shasum": "" }, "require": { @@ -1635,7 +1635,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.4.16" + "source": "https://github.com/symfony/http-client/tree/v7.4.17" }, "funding": [ { @@ -1655,7 +1655,7 @@ "type": "tidelift" } ], - "time": "2026-07-29T16:20:51+00:00" + "time": "2026-08-21T17:40:08+00:00" }, { "name": "symfony/http-client-contracts", @@ -2323,22 +2323,22 @@ }, { "name": "utopia-php/cache", - "version": "4.0.2", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "92e02dab63606234b993b841ebf4c58845dd4620" + "reference": "0d0752785fc81b5afd6571f4291763166a6532bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/92e02dab63606234b993b841ebf4c58845dd4620", - "reference": "92e02dab63606234b993b841ebf4c58845dd4620", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/0d0752785fc81b5afd6571f4291763166a6532bc", + "reference": "0d0752785fc81b5afd6571f4291763166a6532bc", "shasum": "" }, "require": { "ext-json": "*", "php": ">=8.4", - "utopia-php/circuit-breaker": "^0.3", + "utopia-php/circuit-breaker": "^0.4", "utopia-php/pools": "^2.0", "utopia-php/telemetry": "^0.4" }, @@ -2376,22 +2376,22 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/4.0.2" + "source": "https://github.com/utopia-php/cache/tree/5.0.0" }, - "time": "2026-08-12T07:48:59+00:00" + "time": "2026-08-21T11:04:48+00:00" }, { "name": "utopia-php/circuit-breaker", - "version": "0.3.2", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/utopia-php/circuit-breaker.git", - "reference": "5fbc3802471b0d1b4260bd9f5544514e6929b481" + "reference": "c6d93c7ba9d895cf906360e000f74ff762d83e17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/circuit-breaker/zipball/5fbc3802471b0d1b4260bd9f5544514e6929b481", - "reference": "5fbc3802471b0d1b4260bd9f5544514e6929b481", + "url": "https://api.github.com/repos/utopia-php/circuit-breaker/zipball/c6d93c7ba9d895cf906360e000f74ff762d83e17", + "reference": "c6d93c7ba9d895cf906360e000f74ff762d83e17", "shasum": "" }, "require": { @@ -2435,9 +2435,9 @@ ], "support": { "issues": "https://github.com/utopia-php/circuit-breaker/issues", - "source": "https://github.com/utopia-php/circuit-breaker/tree/0.3.2" + "source": "https://github.com/utopia-php/circuit-breaker/tree/0.4.0" }, - "time": "2026-08-05T18:07:20+00:00" + "time": "2026-08-21T10:20:24+00:00" }, { "name": "utopia-php/console", @@ -2493,12 +2493,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "63bd77d0735a81280d99a9e6960bb36ecd1c902e" + "reference": "3a49a6c5f8e2c6a362b806d164265bd567bf5ec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/63bd77d0735a81280d99a9e6960bb36ecd1c902e", - "reference": "63bd77d0735a81280d99a9e6960bb36ecd1c902e", + "url": "https://api.github.com/repos/utopia-php/database/zipball/3a49a6c5f8e2c6a362b806d164265bd567bf5ec9", + "reference": "3a49a6c5f8e2c6a362b806d164265bd567bf5ec9", "shasum": "" }, "require": { @@ -2508,18 +2508,19 @@ "ext-redis": "*", "php": ">=8.5", "utopia-php/async": "^0.1", - "utopia-php/cache": "^4.0", - "utopia-php/console": "^0.1", - "utopia-php/mongo": "^1.0", - "utopia-php/pools": "^2.0", - "utopia-php/query": "^0.5", - "utopia-php/validators": "^0.4 || ^0.5" + "utopia-php/cache": "^4.0 || ^5.0", + "utopia-php/console": "0.1.*", + "utopia-php/mongo": "1.*", + "utopia-php/pools": "2.*", + "utopia-php/query": "0.6.*", + "utopia-php/validators": "^0.5" }, "require-dev": { "brianium/paratest": "7.20.*", "fakerphp/faker": "1.23.*", "laravel/pint": "*", "phpstan/phpstan": "2.1.*", + "phpstan/phpstan-phpunit": "2.0.*", "phpunit/phpunit": "12.5.*", "rregeer/phpunit-coverage-check": "0.3.*", "swoole/ide-helper": "5.1.3", @@ -2583,7 +2584,7 @@ "source": "https://github.com/utopia-php/database/tree/feat-query-lib", "issues": "https://github.com/utopia-php/database/issues" }, - "time": "2026-08-21T07:15:17+00:00" + "time": "2026-08-26T07:43:53+00:00" }, { "name": "utopia-php/mongo", @@ -2704,16 +2705,16 @@ }, { "name": "utopia-php/query", - "version": "0.5.0", + "version": "0.6.0", "source": { "type": "git", "url": "https://github.com/utopia-php/query.git", - "reference": "802821c6fb0470410e1f0e65561cc16224c343c0" + "reference": "abaebb2f3426bdbc6f44bab04254a668de937148" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/query/zipball/802821c6fb0470410e1f0e65561cc16224c343c0", - "reference": "802821c6fb0470410e1f0e65561cc16224c343c0", + "url": "https://api.github.com/repos/utopia-php/query/zipball/abaebb2f3426bdbc6f44bab04254a668de937148", + "reference": "abaebb2f3426bdbc6f44bab04254a668de937148", "shasum": "" }, "require": { @@ -2747,9 +2748,9 @@ ], "support": { "issues": "https://github.com/utopia-php/query/issues", - "source": "https://github.com/utopia-php/query/tree/0.5.0" + "source": "https://github.com/utopia-php/query/tree/0.6.0" }, - "time": "2026-08-21T06:16:10+00:00" + "time": "2026-08-21T11:03:36+00:00" }, { "name": "utopia-php/telemetry", From 8f451ddb77cc4d2eab2695f5598f2063a2eae205 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 27 Aug 2026 13:46:54 +1200 Subject: [PATCH 9/9] chore(deps): re-pin the database lock to the split query-lib head utopia-php/database#823 moved its ORM, repository/seeder and migration-runner layers into stacked PRs, so its branch head moved. Nothing here referenced any of them. Co-Authored-By: Claude Opus 5 --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 4278a4c..9a0bf67 100644 --- a/composer.lock +++ b/composer.lock @@ -2493,12 +2493,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "3a49a6c5f8e2c6a362b806d164265bd567bf5ec9" + "reference": "c6ae48dbf0104ff4b6cb8a0ac173ab0dfcd23ef7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/3a49a6c5f8e2c6a362b806d164265bd567bf5ec9", - "reference": "3a49a6c5f8e2c6a362b806d164265bd567bf5ec9", + "url": "https://api.github.com/repos/utopia-php/database/zipball/c6ae48dbf0104ff4b6cb8a0ac173ab0dfcd23ef7", + "reference": "c6ae48dbf0104ff4b6cb8a0ac173ab0dfcd23ef7", "shasum": "" }, "require": { @@ -2584,7 +2584,7 @@ "source": "https://github.com/utopia-php/database/tree/feat-query-lib", "issues": "https://github.com/utopia-php/database/issues" }, - "time": "2026-08-26T07:43:53+00:00" + "time": "2026-08-27T01:20:20+00:00" }, { "name": "utopia-php/mongo",