HumHub Documentation (unofficial)

ModuleAutoLoader
in package
implements BootstrapInterface

ModuleAutoLoader automatically searches for config.php files in module folder an executes them.

Tags
author

luke

Table of Contents

Interfaces

BootstrapInterface
BootstrapInterface is the interface that should be implemented by classes who want to participate in the application bootstrap process.

Constants

CACHE_ID  = 'module_configs'
CONFIGURATION_FILE  = 'config.php'

Methods

bootstrap()  : mixed
Bootstrap method to be called during application bootstrap stage.
locateModules()  : array<string|int, array<string|int, mixed>>
Find available modules
findModules()  : array<string|int, array<string|int, mixed>>
Find all modules with configured paths
findModulesByPath()  : array<string|int, string>
Find all directories with a configuration file inside
getModuleConfigByPath()  : array<string|int, mixed>

Constants

Methods

locateModules()

Find available modules

public static locateModules() : array<string|int, array<string|int, mixed>>
Tags
throws
ErrorException

On invalid module autoload path

Return values
array<string|int, array<string|int, mixed>>

Array of module configurations with module ID as index. Read from cache if available and YII_DEBUG is disabled

findModules()

Find all modules with configured paths

private static findModules(array<string|int, string> $paths) : array<string|int, array<string|int, mixed>>
Parameters
$paths : array<string|int, string>
Tags
throws
ErrorException

On invalid module autoload path

Return values
array<string|int, array<string|int, mixed>>

Array of module configurations with module ID as index

findModulesByPath()

Find all directories with a configuration file inside

private static findModulesByPath(string $path) : array<string|int, string>
Parameters
$path : string
Tags
throws
InvalidArgumentException
Return values
array<string|int, string>

getModuleConfigByPath()

private static getModuleConfigByPath(string $modulePath) : array<string|int, mixed>
Parameters
$modulePath : string
Return values
array<string|int, mixed>

        
On this page

Search results