generated from Nodarx/template
feat: initial version
Signed-off-by: Sebastian Krupinski <root@LAPTOP-7DVOR6NC>
This commit was merged in pull request #1.
This commit is contained in:
97
lib/Module.php
Normal file
97
lib/Module.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXM\ProviderImapMail;
|
||||
|
||||
use KTXC\Resource\ProviderManager;
|
||||
use KTXF\Module\ModuleBrowserInterface;
|
||||
use KTXF\Module\ModuleConsoleInterface;
|
||||
use KTXF\Module\ModuleInstanceAbstract;
|
||||
use KTXF\Resource\Provider\ProviderInterface;
|
||||
use KTXM\ProviderImapMail\Console\ServiceConnectCommand;
|
||||
use KTXM\ProviderImapMail\Console\ServiceDiscoverCommand;
|
||||
use KTXM\ProviderImapMail\Console\ServiceDisconnectCommand;
|
||||
use KTXM\ProviderImapMail\Console\ServiceTestCommand;
|
||||
use KTXM\ProviderImapMail\Providers\Provider as MailProvider;
|
||||
|
||||
/**
|
||||
* IMAP Mail Provider Module
|
||||
*
|
||||
* Registers the IMAP mail provider with the Ktrix provider manager.
|
||||
*/
|
||||
class Module extends ModuleInstanceAbstract implements ModuleConsoleInterface, ModuleBrowserInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ProviderManager $providerManager,
|
||||
) {}
|
||||
|
||||
public function handle(): string
|
||||
{
|
||||
return 'provider_imap_mail';
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return 'IMAP Mail Provider';
|
||||
}
|
||||
|
||||
public function author(): string
|
||||
{
|
||||
return 'Ktrix';
|
||||
}
|
||||
|
||||
public function description(): string
|
||||
{
|
||||
return 'IMAP provider module for Ktrix — provides mail services via the IMAP protocol';
|
||||
}
|
||||
|
||||
public function version(): string
|
||||
{
|
||||
return '0.0.1';
|
||||
}
|
||||
|
||||
public function permissions(): array
|
||||
{
|
||||
return [
|
||||
'provider_imap_mail' => [
|
||||
'label' => 'Access IMAP Mail Provider',
|
||||
'description' => 'View and access the IMAP mail provider module',
|
||||
'group' => 'Providers',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
$this->providerManager->register(ProviderInterface::TYPE_MAIL, 'imap', MailProvider::class);
|
||||
}
|
||||
|
||||
public function registerCI(): array
|
||||
{
|
||||
return [
|
||||
ServiceDiscoverCommand::class,
|
||||
ServiceConnectCommand::class,
|
||||
ServiceDisconnectCommand::class,
|
||||
ServiceTestCommand::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function registerBI(): array
|
||||
{
|
||||
return [
|
||||
'handle' => $this->handle(),
|
||||
'namespace' => 'ProviderImapMail',
|
||||
'version' => $this->version(),
|
||||
'label' => $this->label(),
|
||||
'author' => $this->author(),
|
||||
'description' => $this->description(),
|
||||
'boot' => 'static/module.mjs',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user