ModuleManager
class ModuleManager
Class ModuleManager
Traits
Properties
static protected bool | $singletonArray | Set to true if you want use more that one singleton using and index param in getInstance | from Singleton |
static protected string | $basePath | The base path where config files are placed. | from Singleton |
static private string | $className | Name of the class | from Singleton |
static private array | $instances | Hold the classes on instance. | from Singleton |
protected bool | $separateConfigFile | Set to true if you want to save configuration in a separate file | from Singleton |
static protected array | $modules | Contains all modules. | |
static protected array | $enabledModules | Contains all enabled modules. | |
static private Translator | $translator | The translator manager. | |
static private Router | $router | Route to manage available routes. | |
static private TemplateRender | $renderer | Manage the renderer. | |
static private Module | $module | Module model to do queries. |
Methods
Return this instance.
Save config to file.
Returns the data from database.
Return default values
Initialization, equivalent to __construct and must be called from main class.
Container constructor.
Return the full modules from database.
Return a list of enabled modules from database.
Initialize modules.
Adds enabled module folders to translator.
Returns a list of folder from enabled modules.
Adds enabled module folders to renderer.
Exec Initializer::init() from each enabled module.
Execute all preprocessors from one point.
Run preprocessors for update modules dependencies.
Return a list of enabled folders.
Enable a module.
Disable a module.
Details
at line 118
static
ModuleManager
getInstance()
Return this instance.
in
Singleton
at line 88
static private string
getClassName()
Returns the class name.
in
Singleton
at line 103
bool
setConfig(array $params, bool $merge = true, string $index = 'main')
Save config to file.
in
Singleton
at line 130
private array
getYamlContent()
Returns the content of the Yaml file.
in
Singleton
at line 152
string
getFilePath()
Return the full file config path.
in
Singleton
at line 162
string
getFileName()
Return the file name.
in
Singleton
at line 172
static string
yamlName()
Return the classname for yaml file.
in
Singleton
at line 184
protected bool
fileExists(string $filename)
Returns if file exists.
at line 305
array
getConfig()
Returns the data from database.
at line 128
static array
getDefaultValues()
Return default values
in
Singleton
at line 215
string
getBasePath()
Return the base path.
in
Singleton
at line 223
protected
initSingleton()
Initialization, equivalent to __construct and must be called from main class.
at line 71
__construct()
Container constructor.
at line 90
static array
getModules()
Return the full modules from database.
at line 104
static array
getEnabledModules()
Return a list of enabled modules from database.
at line 137
static
initializeModules()
Initialize modules.
at line 149
static private
addTranslatorFolders()
Adds enabled module folders to translator.
at line 159
static private array
getFoldersEnabledModules()
Returns a list of folder from enabled modules.
at line 171
static private
addRenderFolders()
Adds enabled module folders to renderer.
at line 186
static private
runInitializer()
Exec Initializer::init() from each enabled module.
at line 206
static
executePreprocesses()
Execute all preprocessors from one point.
at line 227
static
runPreprocessors()
Run preprocessors for update modules dependencies.
at line 242
static array
getEnabledFolders()
Return a list of enabled folders.
at line 259
static bool
enableModule(string $name)
Enable a module.
at line 283
static bool
disableModule(string $name)
Disable a module.