-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathautoloader.php
More file actions
32 lines (28 loc) · 922 Bytes
/
autoloader.php
File metadata and controls
32 lines (28 loc) · 922 Bytes
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
<?php
include('config.php');
$site_root=$_SERVER['DOCUMENT_ROOT'];
putenv('TZ='.$config['server_timezone']);
date_default_timezone_set($config['server_timezone']);
include($site_root.'/class/viz_jsonrpc.php');
include($site_root.'/class/viz_keys.php');
include($site_root.'/class/db.php');
include($site_root.'/class/template.php');
$db=new DataManagerDatabase($config['db_host'],$config['db_login'],$config['db_password']);
$db->db($config['db_base'],'utf8mb4');
if(!$db->link){
print '<html><head></head><body>Server restarting... <!-- '.$config['db_host'].' --></body></html>';
exit;
}
$t=new DataManagerTemplate($site_root.'/templates/');
$script_change_time=filemtime('./app.js');
$css_change_time=filemtime('./app.css');
$time=time();
$ip='';
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else{
if(isset($_SERVER['REMOTE_ADDR'])){
$ip=$_SERVER['REMOTE_ADDR'];
}
}