ModuleAutoLoader
in package
implements
BootstrapInterface
ModuleAutoLoader automatically searches for config.php files in module folder an executes them.
Tags
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
CACHE_ID
public
mixed
CACHE_ID
= 'module_configs'
CONFIGURATION_FILE
public
mixed
CONFIGURATION_FILE
= 'config.php'
Methods
bootstrap()
Bootstrap method to be called during application bootstrap stage.
public
bootstrap(Application $app) : mixed
Parameters
- $app : Application
-
the application currently running
Tags
locateModules()
Find available modules
public
static locateModules() : array<string|int, array<string|int, mixed>>
Tags
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
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
Return values
array<string|int, string>getModuleConfigByPath()
private
static getModuleConfigByPath(string $modulePath) : array<string|int, mixed>
Parameters
- $modulePath : string