/
bootstrap.php
95 lines (79 loc) · 2.23 KB
/
bootstrap.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
<?php
/*
* @package: RichCommerce
* @version: 1.0
* @since: 13 Sept, 2014
*/
/*
* ------------------------------------------------------
* Return false if application is started in CLI Server
* ------------------------------------------------------
*/
if (php_sapi_name() === 'cli-server' || php_sapi_name() === 'cli') {
return false;
}
/*
* include common file
*/
require __DIR__ . '/config/common.php';
/*
* compare php version
*/
if (!is_php())
return false;
/*
* --------------------------------------------------------------
* Include autoloader
* --------------------------------------------------------------
*/
$loader = require BASEPATH . '/vendor/autoload.php';
$app = new \Rich\Foundation\Application();
$app->test();
exit;
return;
/*
* ------------------------------------------------------
* load constants
* ------------------------------------------------------
*/
Autoload::requireFile("constants", "config", true);
/*
* ------------------------------------------------------
* include collection class
* ------------------------------------------------------
*/
Autoload::requireFile("Rich", "system/core");
use System\Core\Rich;
/*
* ------------------------------------------------------
* include base controller
* ------------------------------------------------------
*/
Autoload::requireFile("BaseController", "system/core");
/*
* ------------------------------------------------------
* include URI Helper
* ------------------------------------------------------
*/
Autoload::requireFile("Uri", "system/helpers");
/*
* ------------------------------------------------------
* create uri helper object
* ------------------------------------------------------
*/
$uri = new URI();
Autoload::requireFile("Theme", "system/helpers");
/*
* ------------------------------------------------------
* create router and add it to collection class
* ------------------------------------------------------
*/
$router = new \system\core\Router();
Rich::set("router", $router);
/*
* ------------------------------------------------------
* map application using router
* ------------------------------------------------------
*/
Autoload::requireFile("app-map", "system/core");
// ./system/bootstrap.php