class module_manager

Properties

protected driver_interface $cache
protected driver_interface $db
protected manager $extension_manager
protected string $modules_table
protected string $phpbb_root_path
protected string $php_ext

Methods

__construct(driver_interface $cache, driver_interface $db, manager $ext_manager, string $modules_table, string $phpbb_root_path, string $php_ext)

Constructor

array
get_module_row(int $module_id, string $module_class)

Get row for specified module

array
get_module_infos(string $module_class, string $module = '', bool $use_all_available = false)

Get available module information from module files

array
get_module_branch(int $module_id, string $module_class, string $type = 'all', bool $include_module = true)

Get module branch

remove_cache_file(string $module_class)

Remove modules cache file

update_module_data(array $module_data)

Update/Add module

move_module(int $from_module_id, int $to_parent_id, string $module_class)

Move module around the tree

delete_module(int $module_id, string $module_class)

Remove module from tree

string
move_module_by(array $module_row, string $module_class, string $action = 'move_up', int $steps = 1)

Move module position by $steps up/down

Details

at line 61
__construct(driver_interface $cache, driver_interface $db, manager $ext_manager, string $modules_table, string $phpbb_root_path, string $php_ext)

Constructor

Parameters

driver_interface $cache

Cache driver

driver_interface $db

Database driver

manager $ext_manager

Extension manager

string $modules_table

Module database table's name

string $phpbb_root_path

Path to phpBB's root

string $php_ext

Extension of PHP files

at line 81
array get_module_row(int $module_id, string $module_class)

Get row for specified module

Parameters

int $module_id

ID of the module

string $module_class

Class of the module (acp, ucp, mcp etc...)

Return Value

array

Array of data fetched from the database

Exceptions

module_not_found_exception

at line 111
array get_module_infos(string $module_class, string $module = '', bool $use_all_available = false)

Get available module information from module files

Parameters

string $module_class

Class of the module (acp, ucp, mcp etc...)

string $module

ID of module

bool $use_all_available

Use all available instead of just all enabled extensions

Return Value

array

Array with module information gathered from module info files.

at line 184
array get_module_branch(int $module_id, string $module_class, string $type = 'all', bool $include_module = true)

Get module branch

Parameters

int $module_id

ID of the module

string $module_class

Class of the module (acp, ucp, mcp etc...)

string $type

Type of branch (Expected values: all, parents or children)

bool $include_module

Whether or not to include the specified module with $module_id

Return Value

array

Returns an array containing the modules in the specified branch type.

at line 233
remove_cache_file(string $module_class)

Remove modules cache file

Parameters

string $module_class

Class of the module (acp, ucp, mcp etc...)

at line 248
update_module_data(array $module_data)

Update/Add module

Parameters

array $module_data

The module data

Exceptions

module_not_found_exception

at line 346
move_module(int $from_module_id, int $to_parent_id, string $module_class)

Move module around the tree

Parameters

int $from_module_id

ID of the current parent module

int $to_parent_id

ID of the target parent module

string $module_class

Class of the module (acp, ucp, mcp etc...)

Exceptions

module_not_found_exception

at line 438
delete_module(int $module_id, string $module_class)

Remove module from tree

Parameters

int $module_id

ID of the module to delete

string $module_class

Class of the module (acp, ucp, mcp etc...)

Exceptions

module_exception

at line 487
string move_module_by(array $module_row, string $module_class, string $action = 'move_up', int $steps = 1)

Move module position by $steps up/down

Parameters

array $module_row

Array of module data

string $module_class

Class of the module (acp, ucp, mcp etc...)

string $action

Direction of moving (valid values: move_up or move_down)

int $steps

Number of steps to move module

Return Value

string

Returns the language name of the module

Exceptions

module_not_found_exception