-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.php
More file actions
195 lines (175 loc) · 5.28 KB
/
index.php
File metadata and controls
195 lines (175 loc) · 5.28 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
/* _ _ _ _ _ _ _ _ _
* / \ / \ / \ / \ / \ / \ / \ / \ / \
* ( R | e | b | o | r | n ) ( C | M | S )
* \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
/**
* ---------------------------------------------------------
* Reborn CMS |--RB C^^$--| PHP Content Management System
* ---------------------------------------------------------
*
* @package Reborn CMS
* @version 2.0.0
* @link http://reborncms.com
* @license http://opensource.org/licenses/MIT MIT License (MIT)
* @author Myanmar Links Professional Web Development Team
*/
/**
* ---------------------------------------------------------
* Define Directory Separator Shortcut as DS
* ---------------------------------------------------------
*
* Reborn redefine PHP's Constant DIRECTORY_SEPARATOR to DS.
*
*/
define('DS', DIRECTORY_SEPARATOR);
// Display Errors On
ini_set('display_errors', 'On');
// Change the current dir
chdir(__DIR__);
// Pre defined for application env
$_env = 'dev';
/**
* ---------------------------------------------------------
* Define BASE Path to this folder
* ---------------------------------------------------------
*
* Set reborn base path. Reborn's starting directory path is here!
*
*/
define('BASE', __DIR__ . DS);
/**
* ---------------------------------------------------------
* Load Reborn's sites manager file
* ---------------------------------------------------------
*
* Reborn define other constants for application,
* start timer and memory record for profiling and
* make class alias to easy access for developer.
*
*/
$sites = require __DIR__.'/content/sites.php';
/**
* ---------------------------------------------------------
* Load Reborn's start helper file
* ---------------------------------------------------------
*
* Reborn define other constants for application,
* start timer and memory record for profiling and
* make class alias to easy access for developer.
*
*/
require_once __DIR__.'/heart/reborn/src/start.php';
/**
* ---------------------------------------------------------
* Load Reborn's start file from content
* ---------------------------------------------------------
*
* This is customize file for user.
* Reborn undefied nothing in this file.
* So user can be make customize without git cconflict.
*
*/
require_once __DIR__.'/content/start.php';
/**
* ---------------------------------------------------------
* Initial bootup for UTF-8
* ---------------------------------------------------------
*
* Make handling for Utf8 with Patchwork.
*
*/
\Patchwork\Utf8\Bootup::initAll();
/**
* ---------------------------------------------------------
* Now Create the Reborn Application Instance.
* ---------------------------------------------------------
*
* Create Reborn Application Object to start the application.
*
*/
$app = new Reborn\Cores\Application();
/**
* ---------------------------------------------------------
* Set the Reborn CMS Environment
* ---------------------------------------------------------
*
* Set the environment type for reboen.
* Supported environment are (dev|test|production)
* - "dev" mode for Developing Stage.
* - "test" mode for Testing Stage.
* - "production" mode for Production Stage.
* ******* You must be set mode is "production" for real running stage. *******
*
*/
$app->setAppEnvironment($_env);
unset($_env);
/**
* ---------------------------------------------------------
* Set Error reporting
* ---------------------------------------------------------
*
* Reborn set the error reporting base on application environment.
* Error report are show at "dev" and "test" mode but hide at "production".
*
*/
if($app['env'] != 'production') {
ini_set('display_errors', 'On');
error_reporting(-1);
} else {
error_reporting(0);
ini_set('display_errors', 'Off');
}
/**
* ---------------------------------------------------------
* Set Application Timezone
* ---------------------------------------------------------
*
* Reborn set timezone for application.
* Set timezone for application with "UTC".
* But this timezone will override in Application::start()
* base on application setting.
*
*/
$app->setTimezone();
/**
* ---------------------------------------------------------
* Set Site Data variable to application
* ---------------------------------------------------------
*
* Rebirn set sites variable for application.
* sites variable is data array of multisite configuration.
*
*/
$app['sites'] = $sites;
/**
* ---------------------------------------------------------
* Set Application Object to Facade Class
* ---------------------------------------------------------
*
* Facade class have $app to easy access for Dependency Injection
* Now, set the application object($app) to facade class.
*
*/
\Reborn\Cores\Facade::setApplication($app);
/**
* ---------------------------------------------------------
* Really start point for Reborn CMS
* ---------------------------------------------------------
*
* First reborn check the application is already installed or not.
* If application need to install,
* reborn will run the application installer.
* If application is already installed,
* reborn will run the application starter.
*
*/
if ($app->installed()) {
$app->start();
$app->run();
} else {
$app->install();
}
// Clear the $app.
unset($app);