-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
101 lines (92 loc) · 3.22 KB
/
index.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
#######################################
# #
# ████ █ ██ █████ ██████ ██ ██ #
# ██ ██ ██ ██ ██ ██ ██ ██ #
# ██ ███ ██ ██ ██ ██ ██ ██ #
# ██ ██████ ██ ██ █████ ███ #
# ██ ██ ███ ██ ██ ██ ██ ██ #
# ██ ██ ██ ██ ██ ██ ██ ██ #
# ████ ██ █ █████ ██████ ██ ██ #
# #
#######################################
/**
****************************************
* Description
* @name : index.php
* @Package : Googol
* @Author : Bronco
* @Description : seriously (°_°) ?
* @Version : 2.0
****************************************
**/
###############################
# #
# ▒▒▒▒ ▒▒ ▒▒ ▒▒▒▒ ▒▒▒▒▒▒ #
# ▒▒ ▒▒▒ ▒▒ ▒▒ ▒ ▒▒ ▒ #
# ▒▒ ▒▒▒▒▒▒ ▒▒ ▒▒ #
# ▒▒ ▒▒ ▒▒▒ ▒▒ ▒▒ #
# ▒▒▒▒ ▒▒ ▒▒ ▒▒▒▒ ▒▒▒▒ #
# Context #
###############################
require_once('data/config/constants.php');
require_once(PHP.'load_classes.php');
require_once(APP_PHP.'class_app.php');
require_once(APP_PHP.'class_google.php');
require_once(APP_PHP.'class_startpage.php');
require_once(PHP.'functions.php');
define('CURRENT_URL',tools::getURL());
define('CURRENT_QUERY_URL',CURRENT_URL.'?'.$_SERVER['QUERY_STRING']);
define('BROWSER_TYPE',tools::isMobile());
define('RACINE',tools::getRoot());
# instanciation
$context=[]; # $context contains referencies for the dependency injection in tpl class
if (USE_THUMBNAILS) {
$thumbs =new thumbs();
$context['thumbs']=&$thumbs;
}
if (USE_CACHE) {
$cache =new cache();
$context['cache']=&$cache;
}
if (USE_LOCALE) {
$lang =new language();
$context['lang']=&$lang;
}
if (USE_SECURE) {
$users =new users();
$context['users']=&$users;
$secure =new secure();
$context['secure']=&$secure;
}
if (USE_DB) {
require_once(CONFIG.'db_config.php');
$db =new DB($db,FILES_DB_NAME,$tables);
$context['db']=&$db;
}
if (USE_CFG) {
require_once(CONFIG.'config_format.php');
$cfg =new config(CONFIG,$config_format);
$context['cfg']=&$cfg;
}
if (USE_TEMPLATE) {
$tpl =new TPL([HTML,APP_HTML]);
$context['tpl']=&$tpl;
}
if (USE_REST) {
$rest =new REST();
require_once(APP_PHP.'serverREST.php');
}
require_once(CONFIG.'config.php');
$app=new app();
$context['app']=&$app;
$context['alternatives']=$config['alternatives'];
tools::setInstancesContext($context); # inject the dependencies context into the instances.
tools::handlePostInstances($context); # & handle post/get data destinated to classes (if a class has methods handlePost() or handleGet(), they will be called)
# Application's post & get data
require_once(APP_PHP.'handlePostData.php');
require_once(APP_PHP.'handleGetData.php');
$tpl->echo('header');
$tpl->echo($page);// $page defined in handleGetData
$tpl->echo('footer');
?>