From 7493e16bac4b2297eeaeedcb7318d9f2d359b3e5 Mon Sep 17 00:00:00 2001 From: "Luke B. Silver" <22452787+loks0n@users.noreply.github.com> Date: Thu, 8 May 2025 19:23:04 +0100 Subject: [PATCH] Revert "Merge pull request #9729 from appwrite/update-database-lib" (#9735) This reverts commit a35c955e54f0e859e537155c53fa77f2a11fec08, reversing changes made to 51f44b02b9ea79755703f47bc7087a8fea2db310. --- app/init/registers.php | 11 ++--- composer.json | 4 +- composer.lock | 73 ++++++++++++++-------------- src/Appwrite/Migration/Migration.php | 9 ++-- 4 files changed, 47 insertions(+), 50 deletions(-) diff --git a/app/init/registers.php b/app/init/registers.php index 1adaaf35ce..1ebcbc1691 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -15,7 +15,6 @@ use Utopia\Config\Config; use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Adapter\MySQL; use Utopia\Database\Adapter\SQL; -use Utopia\Database\PDO; use Utopia\Domains\Validator\PublicDomain; use Utopia\DSN\DSN; use Utopia\Logger\Adapter\AppSignal; @@ -217,11 +216,11 @@ $register->set('pools', function () { 'mariadb' => function () use ($dsnHost, $dsnPort, $dsnUser, $dsnPass, $dsnDatabase) { return new PDOProxy(function () use ($dsnHost, $dsnPort, $dsnUser, $dsnPass, $dsnDatabase) { return new PDO("mysql:host={$dsnHost};port={$dsnPort};dbname={$dsnDatabase};charset=utf8mb4", $dsnUser, $dsnPass, array( - \PDO::ATTR_TIMEOUT => 3, // Seconds - \PDO::ATTR_PERSISTENT => false, - \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, - \PDO::ATTR_EMULATE_PREPARES => true, - \PDO::ATTR_STRINGIFY_FETCHES => true + PDO::ATTR_TIMEOUT => 3, // Seconds + PDO::ATTR_PERSISTENT => false, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + PDO::ATTR_EMULATE_PREPARES => true, + PDO::ATTR_STRINGIFY_FETCHES => true )); }); }, diff --git a/composer.json b/composer.json index c143ffedc6..46a2679d65 100644 --- a/composer.json +++ b/composer.json @@ -48,10 +48,10 @@ "utopia-php/abuse": "0.52.*", "utopia-php/analytics": "0.10.*", "utopia-php/audit": "0.55.*", - "utopia-php/cache": "0.13.*", + "utopia-php/cache": "0.12.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.67.*", + "utopia-php/database": "0.66.*", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 17018ad574..0801e799ed 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": "49b9828ae72763d2a398358c28cebdd5", + "content-hash": "f8a8967327763c5b85721583bd78c1de", "packages": [ { "name": "adhocore/jwt", @@ -1179,16 +1179,16 @@ }, { "name": "open-telemetry/context", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/context.git", - "reference": "5f553042b951d3fedf47925852c380159dfca801" + "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/5f553042b951d3fedf47925852c380159dfca801", - "reference": "5f553042b951d3fedf47925852c380159dfca801", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/1eb2b837ee9362db064a6b65d5ecce15a9f9f020", + "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020", "shasum": "" }, "require": { @@ -1234,7 +1234,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-02T01:57:57+00:00" + "time": "2025-05-07T23:36:50+00:00" }, { "name": "open-telemetry/exporter-otlp", @@ -3301,16 +3301,16 @@ }, { "name": "utopia-php/cache", - "version": "0.13.0", + "version": "0.12.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "dee01dec33a211644d60f6cfa56b1b8176d3fae3" + "reference": "646038f1d470b759c129348be8fc14da3c00bbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/dee01dec33a211644d60f6cfa56b1b8176d3fae3", - "reference": "dee01dec33a211644d60f6cfa56b1b8176d3fae3", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/646038f1d470b759c129348be8fc14da3c00bbd9", + "reference": "646038f1d470b759c129348be8fc14da3c00bbd9", "shasum": "" }, "require": { @@ -3318,7 +3318,6 @@ "ext-memcached": "*", "ext-redis": "*", "php": ">=8.0", - "utopia-php/pools": "0.8.*", "utopia-php/telemetry": "0.1.*" }, "require-dev": { @@ -3347,9 +3346,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.13.0" + "source": "https://github.com/utopia-php/cache/tree/0.12.0" }, - "time": "2025-04-17T04:20:26+00:00" + "time": "2025-02-25T09:09:21+00:00" }, { "name": "utopia-php/cli", @@ -3499,23 +3498,23 @@ }, { "name": "utopia-php/database", - "version": "0.67.2", + "version": "0.66.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "cd55117beab0025fd0d3f945a5a004125600982c" + "reference": "67d2ab418efba31dc76b3564cf043e2b3f98d027" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/cd55117beab0025fd0d3f945a5a004125600982c", - "reference": "cd55117beab0025fd0d3f945a5a004125600982c", + "url": "https://api.github.com/repos/utopia-php/database/zipball/67d2ab418efba31dc76b3564cf043e2b3f98d027", + "reference": "67d2ab418efba31dc76b3564cf043e2b3f98d027", "shasum": "" }, "require": { "ext-mbstring": "*", "ext-pdo": "*", "php": ">=8.1", - "utopia-php/cache": "0.13.*", + "utopia-php/cache": "0.12.*", "utopia-php/framework": "0.33.*", "utopia-php/pools": "0.8.*" }, @@ -3549,9 +3548,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.67.2" + "source": "https://github.com/utopia-php/database/tree/0.66.0" }, - "time": "2025-05-06T12:11:58+00:00" + "time": "2025-04-16T07:10:27+00:00" }, { "name": "utopia-php/domains", @@ -4545,28 +4544,28 @@ }, { "name": "utopia-php/vcs", - "version": "0.9.5", + "version": "0.9.4", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "055956545ca7ab4e8688df5de1df3e2833859793" + "reference": "1a8d280b176acc99ea8d9e7364b8767cbb206b4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/055956545ca7ab4e8688df5de1df3e2833859793", - "reference": "055956545ca7ab4e8688df5de1df3e2833859793", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/1a8d280b176acc99ea8d9e7364b8767cbb206b4a", + "reference": "1a8d280b176acc99ea8d9e7364b8767cbb206b4a", "shasum": "" }, "require": { "adhocore/jwt": "^1.1", "php": ">=8.0", - "utopia-php/cache": "0.13.*", + "utopia-php/cache": "0.12.*", "utopia-php/framework": "0.*.*", "utopia-php/system": "0.9.*" }, "require-dev": { - "laravel/pint": "1.*.*", - "phpstan/phpstan": "1.*.*", + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.8.*", "phpunit/phpunit": "^9.4" }, "type": "library", @@ -4589,9 +4588,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.9.5" + "source": "https://github.com/utopia-php/vcs/tree/0.9.4" }, - "time": "2025-04-17T04:38:49+00:00" + "time": "2025-03-13T10:09:45+00:00" }, { "name": "utopia-php/websocket", @@ -5043,16 +5042,16 @@ }, { "name": "laravel/pint", - "version": "v1.22.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36" + "reference": "941d1927c5ca420c22710e98420287169c7bcaf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", - "reference": "7ddfaa6523a675fae5c4123ee38fc6bfb8ee4f36", + "url": "https://api.github.com/repos/laravel/pint/zipball/941d1927c5ca420c22710e98420287169c7bcaf7", + "reference": "941d1927c5ca420c22710e98420287169c7bcaf7", "shasum": "" }, "require": { @@ -5064,11 +5063,11 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.75.0", - "illuminate/view": "^11.44.2", - "larastan/larastan": "^3.3.1", + "illuminate/view": "^11.44.7", + "larastan/larastan": "^3.4.0", "laravel-zero/framework": "^11.36.1", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^2.3", + "nunomaduro/termwind": "^2.3.1", "pestphp/pest": "^2.36.0" }, "bin": [ @@ -5105,7 +5104,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2025-04-08T22:11:45+00:00" + "time": "2025-05-08T08:38:12+00:00" }, { "name": "matthiasmullie/minify", diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 6f299d74e5..56016f1057 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -9,7 +9,6 @@ use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; -use Utopia\Database\PDO; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\System\System; @@ -39,9 +38,9 @@ abstract class Migration protected Database $consoleDB; /** - * @var PDO + * @var \PDO */ - protected PDO $pdo; + protected \PDO $pdo; /** * @var array @@ -147,10 +146,10 @@ abstract class Migration /** * Set PDO for Migration. * - * @param PDO $pdo + * @param \PDO $pdo * @return \Appwrite\Migration\Migration */ - public function setPDO(PDO $pdo): self + public function setPDO(\PDO $pdo): self { $this->pdo = $pdo;