forked from ZonD80/appaddict.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.php
81 lines (67 loc) · 2.18 KB
/
init.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
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
<?php
/**
* Script that initializes all stuff
*
*/
define('INIT', true);
define('DS', DIRECTORY_SEPARATOR);
define('TIME', time());
define('MICROTIME', microtime(true));
//ini_set('session.cache_limiter', ''); // prevent no-cache
require_once 'classes' . DS . 'api.class.php';
require_once 'functions.inc.php';
$db = array(
'host' => 'localhost',
'user' => 'aa',
'pass' => 'fsj318hf8FWFih2380h',
'db' => 'aa',
'charset' => 'utf8'
);
$CONFIG = array(
'defaultbaseurl' => 'https://www.appaddict.org',
'sitename' => 'AppAddict',
'siteemail' => '[email protected]',
'adminemail' => '[email protected]',
'ROOT_PATH' => dirname(__FILE__) . DS,
'debug_language' => 1,
'static_language_dir' => '',//languages', // set to empty if you do not use static languages
'languages' => 'en,de,fr,ru,pt,it,ar,sr,ro,es,tr,hg',
'TIME' => time(),
'START' => microtime(true),
'CACHEDRIVER' => 'native', // or native for file cache
'cache_dir' => dirname(__FILE__) . DS . 'cache',
'TEMPLATE_PATH' => ($_COOKIE['test_tpl']?dirname(__FILE__) . DS . 'test_tpl':dirname(__FILE__) . DS . 'tpl'),
'use_compression' => true, // use zlib compression
'GOOGLE_API_KEY' => 'AIzaSyARyGHgnp7ClUUWZeG4cHcy3FIJri2vejk',
'CRONTAB' => 'cli', // or cli for crontab usage
'REDIRECTOR_SECRET'=>'AA_d_engine', // passhprase for redirector link encryption
'redirection_wait'=>30, // how many seconds wait for redirect
'report_status'=>true, // use status pinging feature
);
$API = new API($CONFIG, $db);
$API->TPL->template_dir = $CONFIG['TEMPLATE_PATH'];
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
define("AJAX", true);
else
define("AJAX", false);
$API->LANG = new LANG($API);
$API->TPL->assign('COUNTRY_FLAGS', array(
'ru' => 'russia',
'en' => 'usa',
'de' => 'germany',
'pt' => 'portugal',
'it' => 'italy',
'ar' => 'saudi_arabia',
'sr' => 'serbia',
'fr' => 'france',
'es' => 'spain',
'ro' => 'romania',
'tr' => 'turkey',
'hg' => 'hungary',
));
if (PHP_SAPI!='cli'&&file_get_contents($CONFIG['ROOT_PATH'].'/status')) {
$API->TPL->display('beback.tpl');
die();
}
$API->session();
?>