-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.php
38 lines (36 loc) · 1.16 KB
/
hooks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* WHMCS SDK Sample Addon Module Hooks File
*
* Hooks allow you to tie into events that occur within the WHMCS application.
*
* This allows you to execute your own code in addition to, or sometimes even
* instead of that which WHMCS executes by default.
*
* @see https://developers.whmcs.com/hooks/
*
* @copyright Copyright (c) WHMCS Limited 2017
* @license http://www.whmcs.com/license/ WHMCS Eula
*/
// Require any libraries needed for the module to function.
// require_once __DIR__ . '/path/to/library/loader.php';
//
// Also, perform any initialization required by the service's library.
/**
* Register a hook with WHMCS.
*
* This sample demonstrates triggering a service call when a change is made to
* a client profile within WHMCS.
*
* For more information, please refer to https://developers.whmcs.com/hooks/
*
* add_hook(string $hookPointName, int $priority, string|array|Closure $function)
*/
add_hook('ClientEdit', 1, function(array $params) {
try {
// Call the service's function, using the values provided by WHMCS in
// `$params`.
} catch (Exception $e) {
// Consider logging or reporting the error.
}
});