after_entry_point
Overview
The after_entry_point
application hook executes at the start of every request.
Definition
function after_entry_point($event, $arguments){}
Arguments
Name | Type | Description |
event | String | The current event |
arguments | Array | Additional information related to the event (typically empty) |
Considerations
- The
after_entry_point
hook is a global logic hook where the logic hook reference must be placed in./custom/modules/logic_hooks.php
. - This hook is executed at the start of every request at the end of
./include/entryPoint.php
. - This hook should not be used for any type of display output.
- The
after_entry_point
hook is ideally used for logging or loading libraries. - Application hooks do not make use of the
$bean
argument.
Change Log
Version | Note | |
6.4.3 | Added after_entry_point hook |
Example
./custom/modules/logic_hooks.php
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['after_entry_point'] = Array();
$hook_array['after_entry_point'][] = Array(
//Processing index. For sorting the array.
1,
//Label. A string value to identify the hook.
'after_entry_point example',
//The PHP file where your class is located.
'custom/modules/application_hooks_class.php',
//The class the method is in.
'application_hooks_class',
//The method to call.
'after_entry_point_method'
);
?>
./custom/modules/application_hooks_class.php
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class application_hooks_class
{
function after_entry_point_method($event, $arguments)
{
//logic
}
}
?>