Initial Version
This commit is contained in:
13
shared/lib/Module/ModuleBrowserInterface.php
Normal file
13
shared/lib/Module/ModuleBrowserInterface.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KTXF\Module;
|
||||
|
||||
/**
|
||||
* Module Browser Interface
|
||||
*/
|
||||
interface ModuleBrowserInterface
|
||||
{
|
||||
public function registerBI(): array;
|
||||
}
|
||||
13
shared/lib/Module/ModuleConsoleInterface.php
Normal file
13
shared/lib/Module/ModuleConsoleInterface.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KTXF\Module;
|
||||
|
||||
/**
|
||||
* Module Console Interface
|
||||
*/
|
||||
interface ModuleConsoleInterface
|
||||
{
|
||||
public function registerCI(): array;
|
||||
}
|
||||
73
shared/lib/Module/ModuleInstanceAbstract.php
Normal file
73
shared/lib/Module/ModuleInstanceAbstract.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace KTXF\Module;
|
||||
|
||||
abstract class ModuleInstanceAbstract implements ModuleInstanceInterface
|
||||
{
|
||||
// mandatory methods that must be implemented by each concrete module
|
||||
abstract public function handle(): string;
|
||||
|
||||
abstract public function version(): string;
|
||||
|
||||
abstract public function label(): string;
|
||||
|
||||
abstract public function description(): string;
|
||||
|
||||
abstract public function author(): string;
|
||||
|
||||
// optional methods that can be overridden by specific modules
|
||||
public function install(): void
|
||||
{
|
||||
// Override in specific modules if needed
|
||||
}
|
||||
|
||||
public function uninstall(): void
|
||||
{
|
||||
// Override in specific modules if needed
|
||||
}
|
||||
|
||||
public function enable(): void
|
||||
{
|
||||
// Override in specific modules if needed
|
||||
}
|
||||
|
||||
public function disable(): void
|
||||
{
|
||||
// Override in specific modules if needed
|
||||
}
|
||||
|
||||
public function upgrade(): void
|
||||
{
|
||||
// Override in specific modules if needed
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
// Override in specific modules if needed
|
||||
}
|
||||
|
||||
/**
|
||||
* Permissions provided by this module
|
||||
*
|
||||
* @return array Permission definitions with metadata
|
||||
*
|
||||
* @example
|
||||
* return [
|
||||
* 'user_manager.users.view' => [
|
||||
* 'label' => 'View Users',
|
||||
* 'description' => 'View user list and details',
|
||||
* 'group' => 'User Management'
|
||||
* ],
|
||||
* 'user_manager.users.*' => [
|
||||
* 'label' => 'Full User Management',
|
||||
* 'description' => 'All user management permissions',
|
||||
* 'group' => 'User Management'
|
||||
* ]
|
||||
* ];
|
||||
*/
|
||||
public function permissions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
61
shared/lib/Module/ModuleInstanceInterface.php
Normal file
61
shared/lib/Module/ModuleInstanceInterface.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace KTXF\Module;
|
||||
|
||||
interface ModuleInstanceInterface
|
||||
{
|
||||
/**
|
||||
* Get module version
|
||||
*/
|
||||
public function handle(): string;
|
||||
|
||||
/**
|
||||
* Get module version
|
||||
*/
|
||||
public function version(): string;
|
||||
|
||||
/**
|
||||
* Get module label
|
||||
*/
|
||||
public function label(): string;
|
||||
|
||||
/**
|
||||
* Get module description
|
||||
*/
|
||||
public function description(): string;
|
||||
|
||||
/**
|
||||
* Get module author
|
||||
*/
|
||||
public function author(): string;
|
||||
|
||||
/**
|
||||
* Install the module
|
||||
*/
|
||||
public function install(): void;
|
||||
|
||||
/**
|
||||
* Uninstall the module
|
||||
*/
|
||||
public function uninstall(): void;
|
||||
|
||||
/**
|
||||
* Upgrade the module
|
||||
*/
|
||||
public function upgrade(): void;
|
||||
|
||||
/**
|
||||
* Enable the module
|
||||
*/
|
||||
public function enable(): void;
|
||||
|
||||
/**
|
||||
* Disable the module
|
||||
*/
|
||||
public function disable(): void;
|
||||
|
||||
/**
|
||||
* Bootstrap the module when enabled
|
||||
*/
|
||||
public function boot(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user