From 4d15e0dbd28fa5f89e6d06579a54374023ccd4dc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 8 Apr 2024 05:03:18 +0000 Subject: [PATCH 1/9] update platform version --- composer.json | 2 +- composer.lock | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 186ba1eff3..f7d4f700cb 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "utopia-php/messaging": "0.3.*", "utopia-php/migration": "0.3.*", "utopia-php/orchestration": "0.9.*", - "utopia-php/platform": "0.5.*", + "utopia-php/platform": "0.6.*", "utopia-php/pools": "0.4.*", "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.7.*", diff --git a/composer.lock b/composer.lock index c8040a54de..58121bc9fc 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": "d4bead528175f70ccaf4f4b8ec03a486", + "content-hash": "9df8a86d34f06281d71fc7ad4e70a563", "packages": [ { "name": "adhocore/jwt", @@ -1796,16 +1796,16 @@ }, { "name": "utopia-php/platform", - "version": "0.5.1", + "version": "0.6.0", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "3eceef0b6593fe0f7d2efd36d40402a395a4c285" + "reference": "6512e761f14f3bf3e510c2f2fdeb064e239d9634" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/3eceef0b6593fe0f7d2efd36d40402a395a4c285", - "reference": "3eceef0b6593fe0f7d2efd36d40402a395a4c285", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/6512e761f14f3bf3e510c2f2fdeb064e239d9634", + "reference": "6512e761f14f3bf3e510c2f2fdeb064e239d9634", "shasum": "" }, "require": { @@ -1813,7 +1813,8 @@ "ext-redis": "*", "php": ">=8.0", "utopia-php/cli": "0.15.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.33.*", + "utopia-php/queue": "0.7.*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -1839,9 +1840,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.5.1" + "source": "https://github.com/utopia-php/platform/tree/0.6.0" }, - "time": "2023-12-26T16:14:41+00:00" + "time": "2024-04-08T04:49:05+00:00" }, { "name": "utopia-php/pools", From 8fe6ce64b212521d8e4a807a31bc84b01fdc5eae Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 8 Apr 2024 05:05:04 +0000 Subject: [PATCH 2/9] create and use core module --- src/Appwrite/Platform/Appwrite.php | 1 + src/Appwrite/Platform/Core.php | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/Appwrite/Platform/Core.php diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 05224799f3..289abd9429 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -10,6 +10,7 @@ class Appwrite extends Platform { public function __construct() { + parent::__construct(new Core()); $this->addService('tasks', new Tasks()); $this->addService('workers', new Workers()); } diff --git a/src/Appwrite/Platform/Core.php b/src/Appwrite/Platform/Core.php new file mode 100644 index 0000000000..1081a9800f --- /dev/null +++ b/src/Appwrite/Platform/Core.php @@ -0,0 +1,9 @@ + Date: Mon, 8 Apr 2024 05:08:55 +0000 Subject: [PATCH 3/9] fix change --- src/Appwrite/Platform/Services/Tasks.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index 8b0cba8e16..89436ba7be 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -11,7 +11,6 @@ use Appwrite\Platform\Tasks\Schedule; use Appwrite\Platform\Tasks\SDKs; use Appwrite\Platform\Tasks\Specs; use Appwrite\Platform\Tasks\SSL; -use Appwrite\Platform\Tasks\Usage; use Appwrite\Platform\Tasks\Vars; use Appwrite\Platform\Tasks\Version; use Appwrite\Platform\Tasks\Upgrade; @@ -20,7 +19,7 @@ class Tasks extends Service { public function __construct() { - $this->type = self::TYPE_CLI; + $this->type = Service::TYPE_TASK; $this ->addAction(Version::getName(), new Version()) ->addAction(Vars::getName(), new Vars()) From 5e12eaa2e34bcada769f30e632aaca2f692e47be Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 8 Apr 2024 05:09:51 +0000 Subject: [PATCH 4/9] fix type --- app/cli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/cli.php b/app/cli.php index 4e1df30f9a..aa6de571ad 100644 --- a/app/cli.php +++ b/app/cli.php @@ -174,7 +174,7 @@ CLI::setResource('logError', function (Registry $register) { }, ['register']); $platform = new Appwrite(); -$platform->init(Service::TYPE_CLI); +$platform->init(Service::TYPE_TASK); $cli = $platform->getCli(); From a67c6bfacb8ba2b60809251b9785a5da0edce104 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 8 Apr 2024 05:16:37 +0000 Subject: [PATCH 5/9] update platform version --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 58121bc9fc..a9942c81bb 100644 --- a/composer.lock +++ b/composer.lock @@ -1796,16 +1796,16 @@ }, { "name": "utopia-php/platform", - "version": "0.6.0", + "version": "0.6.1", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "6512e761f14f3bf3e510c2f2fdeb064e239d9634" + "reference": "48910f25a9746ed35e8c6952ac1f53ceef0213cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/6512e761f14f3bf3e510c2f2fdeb064e239d9634", - "reference": "6512e761f14f3bf3e510c2f2fdeb064e239d9634", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/48910f25a9746ed35e8c6952ac1f53ceef0213cb", + "reference": "48910f25a9746ed35e8c6952ac1f53ceef0213cb", "shasum": "" }, "require": { @@ -1840,9 +1840,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.6.0" + "source": "https://github.com/utopia-php/platform/tree/0.6.1" }, - "time": "2024-04-08T04:49:05+00:00" + "time": "2024-04-08T05:15:31+00:00" }, { "name": "utopia-php/pools", From 70eb56a38863e093408859cd152de7c742beb829 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 8 Apr 2024 05:25:55 +0000 Subject: [PATCH 6/9] refactor module --- src/Appwrite/Platform/Appwrite.php | 1 + src/Appwrite/Platform/{ => Modules}/Core.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename src/Appwrite/Platform/{ => Modules}/Core.php (64%) diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 289abd9429..fac55635d3 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -4,6 +4,7 @@ namespace Appwrite\Platform; use Appwrite\Platform\Services\Tasks; use Appwrite\Platform\Services\Workers; +use Appwrite\Platform\Modules\Core; use Utopia\Platform\Platform; class Appwrite extends Platform diff --git a/src/Appwrite/Platform/Core.php b/src/Appwrite/Platform/Modules/Core.php similarity index 64% rename from src/Appwrite/Platform/Core.php rename to src/Appwrite/Platform/Modules/Core.php index 1081a9800f..ea73e07690 100644 --- a/src/Appwrite/Platform/Core.php +++ b/src/Appwrite/Platform/Modules/Core.php @@ -1,6 +1,6 @@ Date: Tue, 4 Jun 2024 08:04:51 +0000 Subject: [PATCH 7/9] update platform --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 51ba1980d2..bd63ae0ed8 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "utopia-php/messaging": "0.12.*", "utopia-php/migration": "0.4.*", "utopia-php/orchestration": "0.9.*", - "utopia-php/platform": "0.6.*", + "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.5.*", "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.7.*", diff --git a/composer.lock b/composer.lock index 901465a59d..2b3ea5a8fe 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": "fd1d23f289c62d5258bee977f59adaca", + "content-hash": "0695c0e87cc2243a1c28dbed968bc454", "packages": [ { "name": "adhocore/jwt", @@ -2327,16 +2327,16 @@ }, { "name": "utopia-php/platform", - "version": "0.6.1", + "version": "0.7.0", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "48910f25a9746ed35e8c6952ac1f53ceef0213cb" + "reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/48910f25a9746ed35e8c6952ac1f53ceef0213cb", - "reference": "48910f25a9746ed35e8c6952ac1f53ceef0213cb", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/beeea0f2c9bce14a6869fc5c87a1047cdecb5c52", + "reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52", "shasum": "" }, "require": { @@ -2371,9 +2371,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.6.1" + "source": "https://github.com/utopia-php/platform/tree/0.7.0" }, - "time": "2024-04-08T05:15:31+00:00" + "time": "2024-05-08T17:00:55+00:00" }, { "name": "utopia-php/pools", From 131de2ea7a7fd12098ab747a609d478c229f6c25 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 6 Jun 2024 08:35:50 +0000 Subject: [PATCH 8/9] refactor module --- src/Appwrite/Platform/Appwrite.php | 4 ---- src/Appwrite/Platform/Modules/Core.php | 8 ++++++++ src/Appwrite/Platform/Services/Workers.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index fac55635d3..6b3eb077fa 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -2,8 +2,6 @@ namespace Appwrite\Platform; -use Appwrite\Platform\Services\Tasks; -use Appwrite\Platform\Services\Workers; use Appwrite\Platform\Modules\Core; use Utopia\Platform\Platform; @@ -12,7 +10,5 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); - $this->addService('tasks', new Tasks()); - $this->addService('workers', new Workers()); } } diff --git a/src/Appwrite/Platform/Modules/Core.php b/src/Appwrite/Platform/Modules/Core.php index ea73e07690..859ca3b529 100644 --- a/src/Appwrite/Platform/Modules/Core.php +++ b/src/Appwrite/Platform/Modules/Core.php @@ -2,8 +2,16 @@ namespace Appwrite\Platform\Modules; +use Appwrite\Platform\Services\Tasks; +use Appwrite\Platform\Services\Workers; use Utopia\Platform\Module; class Core extends Module { + public function __construct() + { + $this->addService('tasks', new Tasks()); + $this->addService('workers', new Workers()); + } + } diff --git a/src/Appwrite/Platform/Services/Workers.php b/src/Appwrite/Platform/Services/Workers.php index 62a7fcf3fb..0e79f4257c 100644 --- a/src/Appwrite/Platform/Services/Workers.php +++ b/src/Appwrite/Platform/Services/Workers.php @@ -20,7 +20,7 @@ class Workers extends Service { public function __construct() { - $this->type = self::TYPE_WORKER; + $this->type = Service::TYPE_WORKER; $this ->addAction(Audits::getName(), new Audits()) ->addAction(Builds::getName(), new Builds()) From f44ed18b057dfdfaeae9f064183f527e354c48a6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 6 Jun 2024 08:45:15 +0000 Subject: [PATCH 9/9] remove worker index --- app/worker.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/worker.php b/app/worker.php index 60358ad6b2..7037614f8e 100644 --- a/app/worker.php +++ b/app/worker.php @@ -284,11 +284,6 @@ if (!isset($args[1])) { \array_shift($args); $workerName = $args[0]; -$workerIndex = $args[1] ?? ''; - -if (!empty($workerIndex)) { - $workerName .= '_' . $workerIndex; -} if (\str_starts_with($workerName, 'databases')) { $queueName = System::getEnv('_APP_QUEUE_NAME', 'database_db_main');