72 lines
1.7 KiB
PHP
72 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace KTXM\FileProviderLocal;
|
|
|
|
use KTXC\Resource\ProviderManager;
|
|
use KTXF\Module\ModuleBrowserInterface;
|
|
use KTXF\Module\ModuleInstanceAbstract;
|
|
use KTXF\Resource\Provider\ProviderInterface;
|
|
use KTXM\FileProviderLocal\Providers\Provider;
|
|
|
|
/**
|
|
* File Provider Local Module
|
|
*/
|
|
class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
|
{
|
|
public function __construct(
|
|
private readonly ProviderManager $providerManager,
|
|
) {}
|
|
|
|
public function handle(): string
|
|
{
|
|
return 'file_provider_local';
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return 'File Provider Local';
|
|
}
|
|
|
|
public function author(): string
|
|
{
|
|
return 'Ktrix';
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'File provider module for Ktrix - provides local file storage';
|
|
}
|
|
|
|
public function version(): string
|
|
{
|
|
return '0.0.1';
|
|
}
|
|
|
|
public function permissions(): array
|
|
{
|
|
return [
|
|
'file_provider_local' => [
|
|
'label' => 'Access File Provider Local',
|
|
'description' => 'View and access the local file provider module',
|
|
'group' => 'File Providers'
|
|
],
|
|
];
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->providerManager->register(ProviderInterface::TYPE_FILES, 'default', Provider::class);
|
|
}
|
|
|
|
public function registerBI(): array {
|
|
return [
|
|
'handle' => $this->handle(),
|
|
'namespace' => 'FileProviderLocal',
|
|
'version' => $this->version(),
|
|
'label' => $this->label(),
|
|
'author' => $this->author(),
|
|
'description' => $this->description()
|
|
];
|
|
}
|
|
}
|