From cfd290a843971d3aec8f4ef58d47761a7da5f436 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Mon, 11 May 2026 02:57:16 +0100 Subject: [PATCH] fix: require PHP >=8.2, fix latent ColumnStatus filter PHP version constraint (must-fix): - composer.json: php >=8.0 -> >=8.2 (SDK 22+ requires 8.2) - tests.yml matrix: drop 8.1 leg (composer install would fail) - Drop Dockerfile.php-8.1 (now dead) Column status filter (latent bug): - SDK 22+ exposes Column*::status as a ColumnStatus enum object; ColumnIndex::status is still string. The plain \$resource->status !== 'available' check is always true for column results (object !== string under strict equality), making the client-side safety filter dead code in the columns branch. Cast to string so both paths work. --- .github/workflows/tests.yml | 2 +- Dockerfile.php-8.1 | 27 ------------------ composer.json | 2 +- composer.lock | 28 +++++++++---------- .../Adapters/TimeLimit/Appwrite/TablesDB.php | 3 +- 5 files changed, 18 insertions(+), 44 deletions(-) delete mode 100644 Dockerfile.php-8.1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c17c12fbc0..8c48f44f5b 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.1', '8.2', '8.3'] + php-versions: ['8.2', '8.3'] steps: - name: Checkout repository diff --git a/Dockerfile.php-8.1 b/Dockerfile.php-8.1 deleted file mode 100644 index 321055524d..0000000000 --- a/Dockerfile.php-8.1 +++ /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.1-0.1.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 77e5d7ae12..2487bb1238 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "bench": "vendor/bin/phpbench run --report=aggregate" }, "require": { - "php": ">=8.0", + "php": ">=8.2", "ext-pdo": "*", "ext-curl": "*", "ext-redis": "*", diff --git a/composer.lock b/composer.lock index c960ddd9f2..035181eb80 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2818364d7546938e790828df5ee307d1", + "content-hash": "b04b14bd2ea9045a6b56b7aa930aea9f", "packages": [ { "name": "appwrite/appwrite", - "version": "23.0.0", + "version": "23.1.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "d22b36167931294bec4259f0803aba14537030ec" + "reference": "2f275921f10ceb7cff99f2d463f7328b296234fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/d22b36167931294bec4259f0803aba14537030ec", - "reference": "d22b36167931294bec4259f0803aba14537030ec", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/2f275921f10ceb7cff99f2d463f7328b296234fa", + "reference": "2f275921f10ceb7cff99f2d463f7328b296234fa", "shasum": "" }, "require": { @@ -43,10 +43,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/23.0.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/23.1.0", "url": "https://appwrite.io/support" }, - "time": "2026-04-16T12:38:44+00:00" + "time": "2026-05-08T13:44:58+00:00" }, { "name": "brick/math", @@ -2076,16 +2076,16 @@ }, { "name": "utopia-php/cache", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "05ceba981436a4022553f7aaa2a05fa049d0f71c" + "reference": "d36f9050c39c02e09a7763389c9e71258e74af1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/05ceba981436a4022553f7aaa2a05fa049d0f71c", - "reference": "05ceba981436a4022553f7aaa2a05fa049d0f71c", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/d36f9050c39c02e09a7763389c9e71258e74af1f", + "reference": "d36f9050c39c02e09a7763389c9e71258e74af1f", "shasum": "" }, "require": { @@ -2122,9 +2122,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/1.0.1" + "source": "https://github.com/utopia-php/cache/tree/1.0.2" }, - "time": "2026-03-12T03:39:09+00:00" + "time": "2026-05-08T11:40:20+00:00" }, { "name": "utopia-php/console", @@ -5544,7 +5544,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0", + "php": ">=8.2", "ext-pdo": "*", "ext-curl": "*", "ext-redis": "*" diff --git a/src/Abuse/Adapters/TimeLimit/Appwrite/TablesDB.php b/src/Abuse/Adapters/TimeLimit/Appwrite/TablesDB.php index 3b4d544455..bd34dcc2c2 100644 --- a/src/Abuse/Adapters/TimeLimit/Appwrite/TablesDB.php +++ b/src/Abuse/Adapters/TimeLimit/Appwrite/TablesDB.php @@ -116,7 +116,8 @@ class TablesDB extends TimeLimit ? $this->tablesDB->listColumns($this->databaseId, self::TABLE_ID, [Query::notEqual('status', 'available'), Query::limit(1)])->columns : $this->tablesDB->listIndexes($this->databaseId, self::TABLE_ID, [Query::notEqual('status', 'available'), Query::limit(1)])->indexes; - $resources = \array_filter($resources, fn ($resource) => $resource->status !== 'available'); + // Column models expose status as a ColumnStatus enum; index models as a plain string. Cast for both. + $resources = \array_filter($resources, fn ($resource) => (string) $resource->status !== 'available'); if (\count($resources) === 0) { return;