-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.php
42 lines (30 loc) · 1.57 KB
/
config.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
// comment this out for local debug copy
require_once 'Savant3.php';
# taken from http://stackoverflow.com/a/12583387/788054
# TBS cannot use DEFINE(), so these are variables
define('ABS_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
define('BASE_PATH',str_replace(DIRECTORY_SEPARATOR, "/", substr(dirname(__FILE__),strlen($_SERVER['DOCUMENT_ROOT'])).'/'));
# to be deprecated - currently strongly discouraged in official documentation -gg
#function __autoload($class) {
# require_once('lib/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php');
#}
# new style using spl_autoload_register:
spl_autoload_register(function ($class) {
require_once('lib/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php');
});
Emdr::$regions = json_decode(file_get_contents(ABS_PATH.'/emdr/regions.json'),true);
Prefs::getInstance();
$tpl = new Savant3();
$tpl->addPath('template', 'templates/bootstrap');
$tpl->addPath('resource', 'lib');
$tpl->siteTime = new Timer();
$tpl->emdrDown = false;
# https://forums.eveonline.com/default.aspx?g=posts&m=2508255
$regions = json_decode(file_get_contents(dirname(__FILE__).'/emdr/regions.json'),true);
Emdr::setRegion(Prefs::get('region'));
# If price of Tritanium is more than 12 hours old, then something has happened with EMDR consumer
# Set template variable to display warning to user when this happens
if (time() - (new Price(Emdr::get(34)))->generatedAt > 60*60*12) {
$tpl->emdrDown = true; }
$tpl->webkitFix = (preg_match("#.+WebKit/(\H+)+\s.+?#s", $_SERVER['HTTP_USER_AGENT'], $matches) && $matches[1] < 535 ? true : false);