-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsynergycpreseller.php
executable file
·47 lines (40 loc) · 1.3 KB
/
synergycpreseller.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
<?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\WhmcsReseller\App;
use Scp\WhmcsReseller\Whmcs;
/**
* Define WHMCS global functions
*
* @param string $class
*/
function _synergycpreseller_map_class($class) {
foreach ($class::functions() as $name => $method) {
$fullName = 'synergycpreseller_' . $name;
eval('function ' . $fullName . ' (array $params)
{
return ' . App::class . '::get($params)
->make("' . $class . '")
->' . $method . '();
}');
}
}
function _synergycpreseller_map_static_class($class) {
foreach ($class::staticFunctions() as $name => $method) {
$fullName = 'synergycpreseller_' . $name;
eval('function ' . $fullName . ' ()
{
return ' . $class . '::' . $method . '();
}');
}
}
_synergycpreseller_map_class(Whmcs\WhmcsConfig::class);
_synergycpreseller_map_class(Whmcs\WhmcsEvents::class);
_synergycpreseller_map_class(Whmcs\WhmcsButtons::class);
_synergycpreseller_map_class(Whmcs\WhmcsTemplates::class);
_synergycpreseller_map_static_class(Whmcs\Whmcs::class);
_synergycpreseller_map_static_class(Whmcs\WhmcsButtons::class);