Merge pull request #7936 from appwrite/feat-upgrade-platform-with-module
Use latest Platform and add Core module
This commit is contained in:
commit
00a633759e
|
@ -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();
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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
19
composer.lock
generated
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
17
src/Appwrite/Platform/Modules/Core.php
Normal file
17
src/Appwrite/Platform/Modules/Core.php
Normal 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());
|
||||
}
|
||||
|
||||
}
|
|
@ -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())
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue