-
Notifications
You must be signed in to change notification settings - Fork 6
/
synergycp.php
49 lines (42 loc) · 1.21 KB
/
synergycp.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
39
40
41
42
43
44
45
46
47
48
49
<?php
if (!defined('WHMCS')) {
die('This file cannot be accessed directly.');
}
ini_set('display_errors', 'Off');
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING);
require __DIR__.'/bootstrap/autoload.php';
use Scp\Whmcs\App;
use Scp\Whmcs\Whmcs;
/**
* Define WHMCS global functions
*
* @param string $class
*/
function _synergycp_map_class($class)
{
foreach ($class::functions() as $name => $method) {
$fullName = 'synergycp_'.$name;
eval('function '.$fullName.' (array $params)
{
return '.App::class.'::get($params)
->make("'.$class.'")
->'.$method.'();
}');
}
}
function _synergycp_map_static_class($class)
{
foreach ($class::staticFunctions() as $name => $method) {
$fullName = 'synergycp_'.$name;
eval('function '.$fullName.' ()
{
return '.$class.'::'.$method.'();
}');
}
}
_synergycp_map_class(Whmcs\WhmcsConfig::class);
_synergycp_map_class(Whmcs\WhmcsEvents::class);
_synergycp_map_class(Whmcs\WhmcsButtons::class);
_synergycp_map_class(Whmcs\WhmcsTemplates::class);
_synergycp_map_static_class(Whmcs\Whmcs::class);
_synergycp_map_static_class(Whmcs\WhmcsButtons::class);