CRM_Core_Invoke
in package
Given an argument list, invoke the appropriate CRM function Serves as a wrapper between the UserFrameWork and Core CRM
Tags
Table of Contents
Methods
- _invoke() : string
- This is the same as invoke(), but it does *not* include exception handling.
- form() : mixed
- This function contains the default action.
- getItem() : mixed
- Determine which menu $item corresponds to $args
- hackMenuRebuild() : mixed
- Hackish support /civicrm/menu/rebuild
- init() : mixed
- Perform general setup.
- invoke() : string
- This is the main front-controller that integrates with the CMS. Any page-request that is sent to the CMS and intended for CiviCRM should be processed by invoke().
- rebuildMenuAndCaches() : void
- runItem() : mixed
- Given a menu item, call the appropriate controller and return the response
- statusCheck() : mixed
- Show status in the footer (admin only)
- registerPharHandler() : mixed
- Register an alternative phar:// stream wrapper to filter out insecure Phars
Methods
_invoke()
This is the same as invoke(), but it does *not* include exception handling.
public
static _invoke(array<string|int, mixed> $args) : string
Parameters
- $args : array<string|int, mixed>
-
The parts of the URL which identify the intended CiviCRM page (e.g. array('civicrm', 'event', 'register')).
Return values
string —HTML. For non-HTML content, invoke() may call print() and exit().
form()
This function contains the default action.
public
static form(mixed $action, mixed $contact_type, mixed $contact_sub_type) : mixed
Unused function.
Parameters
- $action : mixed
- $contact_type : mixed
- $contact_sub_type : mixed
Tags
getItem()
Determine which menu $item corresponds to $args
public
static getItem(string|array<string|int, string> $args) : mixed
Parameters
- $args : string|array<string|int, string>
-
Path to lookup Ex: 'civicrm/foo/bar' Ex: ['civicrm', 'foo', 'bar']
Tags
hackMenuRebuild()
Hackish support /civicrm/menu/rebuild
public
static hackMenuRebuild(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
-
List of path parts.
Tags
init()
Perform general setup.
public
static init(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
-
List of path parts.
Tags
invoke()
This is the main front-controller that integrates with the CMS. Any page-request that is sent to the CMS and intended for CiviCRM should be processed by invoke().
public
static invoke(array<string|int, mixed> $args) : string
Parameters
- $args : array<string|int, mixed>
-
The parts of the URL which identify the intended CiviCRM page (e.g. array('civicrm', 'event', 'register')).
Return values
string —HTML. For non-HTML content, invoke() may call print() and exit().
rebuildMenuAndCaches()
public
static rebuildMenuAndCaches([bool $triggerRebuild = FALSE ][, bool $sessionReset = FALSE ]) : void
Parameters
- $triggerRebuild : bool = FALSE
- $sessionReset : bool = FALSE
Tags
runItem()
Given a menu item, call the appropriate controller and return the response
public
static runItem(array<string|int, mixed> $item) : mixed
Parameters
- $item : array<string|int, mixed>
-
See CRM_Core_Menu.
Tags
statusCheck()
Show status in the footer (admin only)
public
static statusCheck(CRM_Core_Smarty $template) : mixed
Parameters
- $template : CRM_Core_Smarty
registerPharHandler()
Register an alternative phar:// stream wrapper to filter out insecure Phars
private
static registerPharHandler() : mixed
PHP makes it possible to trigger Object Injection vulnerabilities by using a side-effect of the phar:// stream wrapper that unserializes Phar metadata. To mitigate this vulnerability, projects such as TYPO3 and Drupal have implemented an alternative Phar stream wrapper that disallows inclusion of phar files based on certain parameters.
This code attempts to register the TYPO3 Phar stream wrapper using the interceptor defined in \Civi\Core\Security\PharExtensionInterceptor. In an environment where the stream wrapper was already registered via \TYPO3\PharStreamWrapper\Manager (i.e. Drupal), this code does not do anything. In other environments (e.g. WordPress, at the time of this writing), the TYPO3 library is used to register the interceptor to mitigate the vulnerability.