Jet\Application_Modules_Handler

As already mentioned, the Jet\Application_Modules class is used for working with modules, but it only serves as a container. The actual execution of operations is handled by the handler (itself actually a module), which is always a child of the abstract class Jet\Application_Modules_Handler. In Jet, the default handler is the Jet\Application_Modules_Handler_Default class.

The list of methods and their meaning and behavior is completely identical to that described for the Jet\Application_Modules class (only the methods are not static).

Overview of methods

Method Meaning of
public getModuleDir(
string $module_name
): string
Returns the full path to the module directory of the given name.
public allModulesList(
): Application_Module_Manifest[]
Returns an array of manifests of all modules found, regardless of whether they are installed and active.
public installedModulesList(
): Application_Module_Manifest[]
Returns an array of manifests of all installed modules, even if they are not active.
public activatedModulesList(
): Application_Module_Manifest[]
Returns an array of manifests of all installed and activated modules.
public moduleExists(
string $module_name
): bool
Indicates whether the module exists at all, regardless of whether it is installed and active.
public moduleIsInstalled(
string $module_name
): bool
Indicates whether the module is installed regardless of whether it is active.
public moduleIsActivated(
string $module_name
): bool
Indicates whether the module is installed and active.
public moduleManifest(
string $module_name
): Application_Module_Manifest
Returns the manifest of a specific module.

Warning! The requested module must exist (but does not have to be installed and active).
public installModule(
string $module_name
): void
It installs the module and executes the installation script (if any) during installation.

If anything fails, it throws the Jet\Application_Modules_Exception exception.
public uninstallModule(
string $module_name
): void
Uninstalls the module and during the uninstallation executes the uninstall script (if any).

If anything fails, it throws the Jet\Application_Modules_Exception exception.
public activateModule(
string $module_name
): void
Activates the module.

If anything fails, it throws a Jet\Application_Modules_Exception.
public deactivateModule(
string $module_name
): void
Deactivates the module.

If anything fails, it throws a Jet\Application_Modules_Exception.
public moduleInstance(
string $module_name
): Application_Module
Returns an instance of the Main class of the requested module.

The module must be active. If it is not, then the Jet\Application_Modules_Exception exception is thrown.

This should not happen in the application. Before working with the module, it is advisable to check its availability and solve the application logic accordingly. Alternatively, the module should be mandated and it should be ensured that nobody deactivates it.
public readManifestData(
string $module_name
): void
Read raw data from the manifest file.
public saveManifest(
Application_Module_Manifest $manifest
): void
Writes the manifest data to a file.
Previous chapter
Jet\Application_Modules
Next chapter
Module Manifest - Jet\Application_Module_Manifest