class ModuleManager

Class ModuleManager

Traits

Trait Singleton, This class ensures that all class that use this have only one instance of itself if called as: Class::getInstance()

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

static ModuleManager
getInstance()

Return this instance.

static string
getClassName()

Returns the class name.

from Singleton
bool
setConfig(array $params, bool $merge = true, string $index = 'main')

Save config to file.

from Singleton
array
getYamlContent()

Returns the content of the Yaml file.

from Singleton
string
getFilePath()

Return the full file config path.

from Singleton
string
getFileName()

Return the file name.

from Singleton
static string
yamlName()

Return the classname for yaml file.

from Singleton
bool
fileExists(string $filename)

Returns if file exists.

from Singleton
array
getConfig()

Returns the data from database.

static array
getDefaultValues()

Return default values

string
getBasePath()

Return the base path.

from Singleton
initSingleton()

Initialization, equivalent to __construct and must be called from main class.

from Singleton
__construct()

Container constructor.

static array
getModules()

Return the full modules from database.

static array
getEnabledModules()

Return a list of enabled modules from database.

static 
initializeModules()

Initialize modules.

static 
addTranslatorFolders()

Adds enabled module folders to translator.

static array
getFoldersEnabledModules()

Returns a list of folder from enabled modules.

static 
addRenderFolders()

Adds enabled module folders to renderer.

static 
runInitializer()

Exec Initializer::init() from each enabled module.

static 
executePreprocesses()

Execute all preprocessors from one point.

static 
runPreprocessors()

Run preprocessors for update modules dependencies.

static array
getEnabledFolders()

Return a list of enabled folders.

static bool
enableModule(string $name)

Enable a module.

static bool
disableModule(string $name)

Disable a module.

Details

at line 118
static ModuleManager getInstance()

Return this instance.

Return Value

ModuleManager

in Singleton at line 88
static private string getClassName()

Returns the class name.

Return Value

string

in Singleton at line 103
bool setConfig(array $params, bool $merge = true, string $index = 'main')

Save config to file.

Parameters

array $params
bool $merge
string $index

Return Value

bool

in Singleton at line 130
private array getYamlContent()

Returns the content of the Yaml file.

Return Value

array

in Singleton at line 152
string getFilePath()

Return the full file config path.

Return Value

string

in Singleton at line 162
string getFileName()

Return the file name.

Return Value

string

in Singleton at line 172
static string yamlName()

Return the classname for yaml file.

Return Value

string

in Singleton at line 184
protected bool fileExists(string $filename)

Returns if file exists.

Parameters

string $filename

Return Value

bool

at line 305
array getConfig()

Returns the data from database.

Return Value

array

at line 128
static array getDefaultValues()

Return default values

Return Value

array

in Singleton at line 215
string getBasePath()

Return the base path.

Return Value

string

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.

Return Value

array

at line 104
static array getEnabledModules()

Return a list of enabled modules from database.

Return Value

array

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.

Return Value

array

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.

Return Value

array

at line 259
static bool enableModule(string $name)

Enable a module.

Parameters

string $name

Return Value

bool

at line 283
static bool disableModule(string $name)

Disable a module.

Parameters

string $name

Return Value

bool