From 131de2ea7a7fd12098ab747a609d478c229f6c25 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 6 Jun 2024 08:35:50 +0000 Subject: [PATCH] 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())