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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
error_reporting(0);
ignore_user_abort(TRUE);
if (!session_id())
{
session_start();
}
define('ESTATS_PATH', dirname(__FILE__).'/');
function estats_error_message($Error, $File, $Line, $NotFile = FALSE, $Warning = FALSE)
{
if (!$Warning && !defined('ESTATS_CRITICAL'))
{
define('ESTATS_CRITICAL', TRUE);
}
if (!defined('ESTATS_JSINFORMATION'))
{
echo '<b>eStats '.($Warning?'warning':'error').':</b> <i>'.($NotFile?$Error:'Could not load file: <b>'.$Error.'</b>!').'</i> (<b>'.$File.': '.$Line.'</b>)<br />
';
}
}
if (!defined('ESTATS_ADDRESS'))
{
define('ESTATS_ADDRESS', $_SERVER['REQUEST_URI']);
}
if (!defined('ESTATS_TITLE'))
{
define('ESTATS_TITLE', '');
}
if (defined('ESTATS_COUNT') || defined('ESTATS_JSINFORMATION'))
{
header('Expires: '.gmdate('r', 0));
header('Last-Modified: '.gmdate('r'));
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
if (!include (ESTATS_PATH.'conf/config.php'))
{
estats_error_message('conf/config.php', __FILE__, __LINE__);
}
if (!include (ESTATS_PATH.'lib/driver.class.php'))
{
estats_error_message('lib/driver.class.php', __FILE__, __LINE__);
}
if (!include (ESTATS_PATH.'lib/core.class.php'))
{
estats_error_message('lib/core.class.php', __FILE__, __LINE__);
}
if (!include (ESTATS_PATH.'lib/cookie.class.php'))
{
estats_error_message('lib/cookie.class.php', __FILE__, __LINE__);
}
if (!include (ESTATS_PATH.'lib/cache.class.php'))
{
estats_error_message('lib/cache.class.php', __FILE__, __LINE__);
}
if (!include (ESTATS_PATH.'lib/backups.class.php'))
{
estats_error_message('lib/backups.class.php', __FILE__, __LINE__);
}
if (!include (ESTATS_PATH.'lib/geolocation.class.php'))
{
estats_error_message('lib/geolocation.class.php', __FILE__, __LINE__);
}
if (!defined('ESTATS_CRITICAL') && defined('ESTATS_DATABASE_DRIVER'))
{
if (include (ESTATS_PATH.'plugins/drivers/'.ESTATS_DATABASE_DRIVER.'/plugin.php'))
{
EstatsCore::init(0, ESTATS_SECURITY, ESTATS_PATH, ESTATS_DATA, ESTATS_DATABASE_DRIVER, ESTATS_DATABASE_PREFIX, ESTATS_DATABASE_CONNECTION, ESTATS_DATABASE_USER, ESTATS_DATABASE_PASSWORD, ESTATS_DATABASE_PERSISTENT);
}
else
{
estats_error_message('plugins/drivers/'.ESTATS_DATABASE_DRIVER.'/plugin.php', __FILE__, __LINE__);
}
}
else if (!defined('ESTATS_DATABASE_DRIVER'))
{
estats_error_message('Constant ESTATS_DATABASE_DRIVER not defined!', __FILE__, __LINE__);
}
if (!defined('ESTATS_CRITICAL') && EstatsCore::option('StatsEnabled'))
{
EstatsCore::collectData(defined('ESTATS_COUNT'), ESTATS_ADDRESS, ESTATS_TITLE, (defined('ESTATS_JSINFORMATION')?$JSInformation:array()));
}
}
?>