pm_Hook_ApiCli
in package
implements
pm_Hook_Interface
Hook for processing remote API-CLI requests
Tags
Interfaces, Classes and Traits
- pm_Hook_Interface
- Generic interface for hooks
Table of Contents
- defaultCommand() : mixed
- Default route if not matched any command Displays help message if not overridden
- exitCode() : mixed
- Exit the utility with provided exit code
- getArguments() : array<string|int, mixed>
- Return command-line arguments
- getAvailableCommands() : array<string|int, mixed>
- Return the list of available commands
- getAvailableOptions() : array<string|int, mixed>
- Return the list of available options
- getCommandName() : string
- Return the name of the command that is called
- getOption() : mixed
- Retrieve the option value
- helpCommand() : mixed
- Help command route Displays automatically generated message
- init() : mixed
- Initialize command-line utility
- stderr() : mixed
- Print the message to stderr stream
- stdout() : mixed
- Print the message to stdout stream
Methods
defaultCommand()
Default route if not matched any command Displays help message if not overridden
public
defaultCommand() : mixed
Return values
mixed —exitCode()
Exit the utility with provided exit code
public
exitCode(int $code) : mixed
Parameters
- $code : int
Return values
mixed —getArguments()
Return command-line arguments
public
getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed> —getAvailableCommands()
Return the list of available commands
public
getAvailableCommands() : array<string|int, mixed>
Return values
array<string|int, mixed> —getAvailableOptions()
Return the list of available options
public
getAvailableOptions(string $command) : array<string|int, mixed>
Parameters
- $command : string
Return values
array<string|int, mixed> —getCommandName()
Return the name of the command that is called
public
getCommandName() : string
Return values
string —getOption()
Retrieve the option value
public
getOption(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
Return values
mixed —helpCommand()
Help command route Displays automatically generated message
public
helpCommand() : mixed
Return values
mixed —init()
Initialize command-line utility
public
init() : mixed
Return values
mixed —stderr()
Print the message to stderr stream
public
stderr(string $message) : mixed
Parameters
- $message : string
Return values
mixed —stdout()
Print the message to stdout stream
public
stdout(string $message) : mixed
Parameters
- $message : string