Module
extends BaseConsole
in package
Module CLI.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Class constructor.
- configure() : mixed
- {@inheritDoc}
- execute() : mixed
- {@inheritDoc}
- displaySuccess() : mixed
- Display success message with additional message (if exists).
- executeDisable() : mixed
- Disable a module.
- executeEnable() : mixed
- Enable a module.
- executeInstall() : mixed
- Install a module.
- executeUninstall() : mixed
- Uninstall a module.
- executeUpdate() : mixed
- Update a module.
- getComposerDefault() : string
- Get default composer json file.
- isTargetFileFolderWritable() : bool
- Check if target file and folder is writable.
Properties
$Container
protected
Container
$Container
$Modules
protected
Modules
$Modules
Methods
__construct()
Class constructor.
public
__construct([mixed $name = null ][, Container $Container = null ]) : mixed
Parameters
- $name : mixed = null
- $Container : Container = null
-
The DI container class.
configure()
{@inheritDoc}
protected
configure() : mixed
execute()
{@inheritDoc}
protected
execute(InputInterface $Input, OutputInterface $Output) : mixed
Parameters
- $Input : InputInterface
- $Output : OutputInterface
displaySuccess()
Display success message with additional message (if exists).
private
displaySuccess(SymfonyStyle $Io, string $successMessage[, array<string|int, mixed> $additionalMessages = [] ]) : mixed
Parameters
- $Io : SymfonyStyle
-
The output style class.
- $successMessage : string
-
The success message. This is the main message.
- $additionalMessages : array<string|int, mixed> = []
-
Additional messages in associative array.
resultMessage
is normal additional message. This can be string or array of messages.warningMessage
is warning message. This can be string or array of messages.
executeDisable()
Disable a module.
private
executeDisable(InputInterface $Input, OutputInterface $Output) : mixed
Parameters
- $Input : InputInterface
- $Output : OutputInterface
executeEnable()
Enable a module.
private
executeEnable(InputInterface $Input, OutputInterface $Output) : mixed
Parameters
- $Input : InputInterface
- $Output : OutputInterface
executeInstall()
Install a module.
private
executeInstall(InputInterface $Input, OutputInterface $Output) : mixed
Parameters
- $Input : InputInterface
- $Output : OutputInterface
executeUninstall()
Uninstall a module.
private
executeUninstall(InputInterface $Input, OutputInterface $Output) : mixed
Parameters
- $Input : InputInterface
- $Output : OutputInterface
executeUpdate()
Update a module.
private
executeUpdate(InputInterface $Input, OutputInterface $Output) : mixed
Parameters
- $Input : InputInterface
- $Output : OutputInterface
getComposerDefault()
Get default composer json file.
private
getComposerDefault() : string
Check for composer.mydefault.json first, if not exists then use composer.default.json, if not exists then return empty string.
The composer.default.json file is come with the framework and it can be override when update.
The composer.mydefault.json is user modified and will not be override when update.
Return values
string —Return full path to composer default json file. Or return empty string if not found.
isTargetFileFolderWritable()
Check if target file and folder is writable.
private
isTargetFileFolderWritable(SymfonyStyle $Io) : bool
This will test main app's composer.json and public/Modules folder.
If it is not writable then the error message will be displayed using $Io
class.
Parameters
- $Io : SymfonyStyle
-
The output style class.
Return values
bool —Return true
if writable, false
if it is not.