Class jCoordinator

Description

the main class of the jelix core

this is the "chief orchestra" of the framework. Its goal is to load the configuration, to get the request parameters used to instancie the correspondant controllers and to run the right method.

Located in /core/jCoordinator.class.php (line 24)


	
			
Direct descendents
Class Description
jCmdlineCoordinator The command line version of jCoordinator
Variable Summary
Method Summary
jCoordinator __construct ([ $configFile = ''], [boolean $enableErrorHandler = true], string|object  $config)
void errorHandler (integer $errno, string $errmsg, string $filename, integer $linenum, array $errcontext)
void exceptionHandler (Exception $e)
boolean execOriginalAction ()
void getController (jSelectorAct $selector)
jICoordPlugin getPlugin (string $pluginName, [boolean $required = true])
void handleError (string $type, integer $code, string $message, string $file, integer $line, array $trace)
boolean isPluginEnabled (string $pluginName)
void process ([jRequest $request = null])
void setRequest (jRequest $request)
Variables
jSelectorAct $action = null (line 48)

the selector of the current action

  • access: public
string $actionName (line 67)

the current action name

  • access: public
jLogErrorMessage $errorMessage = null (line 73)

the current error message

  • access: protected
string $moduleName (line 61)

the current module name

  • access: public
jSelectorAct $originalAction = null (line 55)

the original action when there is an internal redirection to an action

different from the one corresponding to the request

  • access: public
array $plugins = array() (line 30)

plugin list

  • access: public
jRequest $request = null (line 42)

current request object

  • access: public
jResponse $response = null (line 36)

current response object

  • access: public
Methods
Constructor __construct (line 82)
jCoordinator __construct ([ $configFile = ''], [boolean $enableErrorHandler = true], string|object  $config)
  • string|object $config: filename of the ini file to configure the framework, or the config object itself this parameter is optional if jApp::loadConfig has been already called
  • boolean $enableErrorHandler: 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
  • $configFile

Redefined in descendants as:
errorHandler (line 287)

Error handler using a response object to return the error.

Replace the default PHP error handler.

  • since: 1.4
void errorHandler (integer $errno, string $errmsg, string $filename, integer $linenum, array $errcontext)
  • integer $errno: error code
  • string $errmsg: error message
  • string $filename: filename where the error appears
  • integer $linenum: line number where the error appears
  • array $errcontext
exceptionHandler (line 316)

Exception handler using a response object to return the error

Replace the default PHP Exception handler

  • since: 1.4
void exceptionHandler (Exception $e)
  • Exception $e: the exception object
execOriginalAction (line 270)

says if the currently executed action is the original one

  • return: true if yes
  • access: public
boolean execOriginalAction ()
getController (line 246)

get the controller corresponding to the selector

  • access: protected
void getController (jSelectorAct $selector)
getErrorMessage (line 370)
  • return: the current error
  • since: 1.3a1
  • access: public
jLogErrorMessage getErrorMessage ()
getGenericErrorMessage (line 358)

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

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

  • access: public
string getGenericErrorMessage ()
getPlugin (line 380)

gets a given coordinator plugin if registered

  • access: public
jICoordPlugin getPlugin (string $pluginName, [boolean $required = true])
  • string $pluginName: the name of the plugin
  • boolean $required: says if the plugin is required or not. If true, will generate an exception if the plugin is not registered.
handleError (line 331)

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

  • since: 1.1
  • access: public
void handleError (string $type, integer $code, string $message, string $file, integer $line, array $trace)
  • string $type: error type : 'error', 'warning', 'notice'
  • integer $code: error code
  • string $message: error message
  • string $file: the file name where the error appear
  • integer $line: the line number where the error appear
  • array $trace: the stack trace

Redefined in descendants as:
isPluginEnabled (line 398)

Says if the given coordinator plugin $name is enabled

  • return: true : plugin is ok
  • access: public
boolean isPluginEnabled (string $pluginName)
  • string $pluginName
process (line 170)

main method : launch the execution of the action.

This method should be called in a entry point.

  • access: public
void process ([jRequest $request = null])
  • jRequest $request: the request object. It is required if a descendant of jCoordinator did not called setRequest before

Redefined in descendants as:
setRequest (line 135)

initialize the given request and some properties of the coordinator

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.

void setRequest (jRequest $request)

Redefined in descendants as:

Documentation generated on Wed, 04 Jan 2017 22:52:53 +0100 by phpDocumentor 1.4.3