1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Merge pull request #7936 from appwrite/feat-upgrade-platform-with-module

Use latest Platform and add Core module
This commit is contained in:
Damodar Lohani 2024-06-09 06:40:13 +05:45 committed by GitHub
commit 00a633759e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 33 additions and 22 deletions

View file

@ -202,7 +202,7 @@ CLI::setResource('logError', function (Registry $register) {
}, ['register']);
$platform = new Appwrite();
$platform->init(Service::TYPE_CLI);
$platform->init(Service::TYPE_TASK);
$cli = $platform->getCli();

View file

@ -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');

View file

@ -61,7 +61,7 @@
"utopia-php/messaging": "0.12.*",
"utopia-php/migration": "0.4.*",
"utopia-php/orchestration": "0.9.*",
"utopia-php/platform": "0.5.*",
"utopia-php/platform": "0.7.*",
"utopia-php/pools": "0.5.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/queue": "0.7.*",

19
composer.lock generated
View file

@ -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": "9ba1190efa21ae307532896397b3228d",
"content-hash": "e002600539435ca8eaaace6e73b4004d",
"packages": [
{
"name": "adhocore/jwt",
@ -2327,16 +2327,16 @@
},
{
"name": "utopia-php/platform",
"version": "0.5.2",
"version": "0.7.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/platform.git",
"reference": "b9feabc79b92dc2b05683a986ad43bce5c1583e3"
"reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/b9feabc79b92dc2b05683a986ad43bce5c1583e3",
"reference": "b9feabc79b92dc2b05683a986ad43bce5c1583e3",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/beeea0f2c9bce14a6869fc5c87a1047cdecb5c52",
"reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52",
"shasum": ""
},
"require": {
@ -2344,7 +2344,8 @@
"ext-redis": "*",
"php": ">=8.0",
"utopia-php/cli": "0.15.*",
"utopia-php/framework": "0.33.*"
"utopia-php/framework": "0.33.*",
"utopia-php/queue": "0.7.*"
},
"require-dev": {
"laravel/pint": "1.2.*",
@ -2370,9 +2371,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/platform/issues",
"source": "https://github.com/utopia-php/platform/tree/0.5.2"
"source": "https://github.com/utopia-php/platform/tree/0.7.0"
},
"time": "2024-05-22T12:50:35+00:00"
"time": "2024-05-08T17:00:55+00:00"
},
{
"name": "utopia-php/pools",
@ -5613,5 +5614,5 @@
"platform-overrides": {
"php": "8.3"
},
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.6.0"
}

View file

@ -2,15 +2,13 @@
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
{
public function __construct()
{
$this->addService('tasks', new Tasks());
$this->addService('workers', new Workers());
parent::__construct(new Core());
}
}

View file

@ -0,0 +1,17 @@
<?php
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());
}
}

View file

@ -22,7 +22,7 @@ class Tasks extends Service
{
public function __construct()
{
$this->type = self::TYPE_CLI;
$this->type = Service::TYPE_TASK;
$this
->addAction(Doctor::getName(), new Doctor())
->addAction(Install::getName(), new Install())

View file

@ -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())