Jelix 1.6.37

jCmdlineCoordinator extends jCoordinator
in package

The command line version of jCoordinator

This allows us to handle exit code of commands properly

Tags
subpackage

core

Table of Contents

$action  : jSelectorAct
the selector of the current action
$actionName  : string
the current action name
$allErrorMessages  : mixed
$moduleName  : string
the current module name
$originalAction  : jSelectorAct
the original action when there is an internal redirection to an action different from the one corresponding to the request
$plugins  : array<string|int, mixed>
plugin list
$request  : jRequest
current request object
$response  : jResponse
current response object
$errorMessage  : jLogErrorMessage
the current error message
__construct()  : mixed
errorHandler()  : mixed
Error handler using a response object to return the error.
exceptionHandler()  : mixed
Exception handler using a response object to return the error Replace the default PHP Exception handler
execOriginalAction()  : bool
says if the currently executed action is the original one
getErrorMessage()  : jLogErrorMessage
getGenericErrorMessage()  : string
return the generic error message (errorMessage in the configuration).
getPlugin()  : jICoordPlugin
gets a given coordinator plugin if registered
handleError()  : mixed
Handle an error event. Called by error handler and exception handler.
isPluginEnabled()  : bool
Says if the given coordinator plugin $name is enabled
process()  : mixed
main method : launch the execution of the action.
getController()  : jController
get the controller corresponding to the selector
setRequest()  : mixed
initialize the given request and some properties of the coordinator
_loadPlugins()  : mixed
load the plugins and their configuration file

Properties

$originalAction

the original action when there is an internal redirection to an action different from the one corresponding to the request

public jSelectorAct $originalAction = ull

Methods

__construct()

public __construct(mixed $configFile[, mixed $enableErrorHandler = true ]) : mixed
Parameters
$configFile : mixed
$enableErrorHandler : mixed = true

enable the error handler of jelix. keep it to true, unless you have something to debug and really have to use the default handler or an other handler

Return values
mixed

errorHandler()

Error handler using a response object to return the error.

public errorHandler(int $errno, string $errmsg, string $filename, int $linenum) : mixed

Replace the default PHP error handler.

Parameters
$errno : int

error code

$errmsg : string

error message

$filename : string

filename where the error appears

$linenum : int

line number where the error appears

Tags
since
1.4
Return values
mixed

exceptionHandler()

Exception handler using a response object to return the error Replace the default PHP Exception handler

public exceptionHandler(Exception $e) : mixed
Parameters
$e : Exception

the exception object

Tags
since
1.4
Return values
mixed

execOriginalAction()

says if the currently executed action is the original one

public execOriginalAction() : bool
Return values
bool

true if yes

getGenericErrorMessage()

return the generic error message (errorMessage in the configuration).

public getGenericErrorMessage() : string

Replaced the %code% pattern in the message by the current error code

Return values
string

getPlugin()

gets a given coordinator plugin if registered

public getPlugin(string $pluginName[, bool $required = true ]) : jICoordPlugin
Parameters
$pluginName : string

the name of the plugin

$required : bool = true

says if the plugin is required or not. If true, will generate an exception if the plugin is not registered.

Tags
throws
jException
Return values
jICoordPlugin

handleError()

Handle an error event. Called by error handler and exception handler.

public handleError(string $type, int $code, string $message, string $file, int $line, array<string|int, mixed> $trace) : mixed
Parameters
$type : string

error type : 'error', 'warning', 'notice'

$code : int

error code

$message : string

error message

$file : string

the file name where the error appear

$line : int

the line number where the error appear

$trace : array<string|int, mixed>

the stack trace

Tags
since
1.1
Return values
mixed

isPluginEnabled()

Says if the given coordinator plugin $name is enabled

public isPluginEnabled(string $pluginName) : bool
Parameters
$pluginName : string
Return values
bool

true : plugin is ok

process()

main method : launch the execution of the action.

public process([jRequestCmdline $request = null ]) : mixed

This method should be called in a Command line entry point.

Parameters
$request : jRequestCmdline = null

the command line request object

Return values
mixed

setRequest()

initialize the given request and some properties of the coordinator

protected setRequest(mixed $request) : mixed

It extracts information for the request to set the module name and the action name. It doesn't verify if the corresponding controller does exist or not. It enables also the error handler of Jelix, if needed. Does not call this method directly in entry points. Prefer to call process() instead (that will call setRequest). setRequest is mostly used for tests or specific contexts.

Parameters
$request : mixed

the request object

Return values
mixed

_loadPlugins()

load the plugins and their configuration file

private _loadPlugins() : mixed
Return values
mixed

Search results