-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.php
42 lines (35 loc) · 1.15 KB
/
common.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
<?php
set_time_limit(0);
date_default_timezone_set('Australia/Melbourne');
require($root_path . 'config.php');
include($root_path . 'includes/constants.php');
include($root_path . 'includes/functions.php');
include($root_path . 'includes/functions_configs.php');
include($root_path . 'includes/functions_logs.php');
$log = new log();
$log->spacer(1);
$configs = new configs();
$dir = scandir($root_path . 'includes/');
array_shift($dir);
array_shift($dir);
foreach ($dir as $file)
{
if (!in_array(substr($file, 0, strrpos($file, '.')), array('functions_configs', 'functions_logs')) && strpos($file, '.' . $phpEx) !== false && preg_match('/functions_([a-zA-Z0-9\-_]*)\.php/', $file, $matches))
{
include($root_path . 'includes/' . $file);
$name = $matches[1];
$$name = new $name();
}
}
$dir = scandir($root_path . 'includes/hooks/');
array_shift($dir);
array_shift($dir);
foreach ($dir as $file)
{
if (strpos($file, '.' . $phpEx) !== false)
{
include($root_path . 'includes/hooks/' . $file);
preg_match('/(hook_([a-zA-Z0-9\-_]*))\.php/', $file, $matches);
$hooks->objects[$matches[2]] = new $matches[1]();
}
}