-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy pathindex.php
More file actions
75 lines (62 loc) · 1.98 KB
/
index.php
File metadata and controls
75 lines (62 loc) · 1.98 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
<?php
/**
* GIT VERSION: 10813
*
* Some of the following constants are automatically filled in when
* the build process is run. If you change them in site/index.php
* and rerun the build process your changes will be lost
*
* APP_PATH absolute path to the php files of the app
* DEBUG_MODE flag to enable easier debugging and development
* CACHE_ID unique string to bust js/css browser caching for a new build
* SITE_ID random site id used for page keys
*/
define('APP_PATH', '');
define('VENDOR_PATH', APP_PATH.'vendor/');
define('CONFIG_PATH', APP_PATH.'config/');
define('WEB_ROOT', '');
define('ASSETS_THEMES_ROOT', '');
define('CACHE_ID', '');
define('SITE_ID', '');
define('JS_HASH', '');
define('CSS_HASH', '');
define('ASSETS_PATH', APP_PATH.'assets/');
/* don't let anything output content until we are ready */
ob_start();
require VENDOR_PATH.'autoload.php';
/* get includes */
require APP_PATH.'lib/framework.php';
$environment = Hm_Environment::getInstance();
$environment->load();
/* initialize glitchtip to capture errors */
$glitchtip_dsn = env('GLITCHTIP_DSN', '');
if ($glitchtip_dsn) {
\Sentry\init([
'dsn' => $glitchtip_dsn,
'traces_sample_rate' => env('GLITCHTIP_TRACES_SAMPLE_RATE', 0.01),
]);
}
define('DEBUG_MODE', filter_var(env('ENABLE_DEBUG', false), FILTER_VALIDATE_BOOLEAN));
/* show all warnings in debug mode */
if (DEBUG_MODE) {
error_reporting(E_ALL);
}
/* get configuration */
$config = new Hm_Site_Config_File();
/* set default TZ */
date_default_timezone_set($config->get('default_setting_timezone', 'UTC'));
/* set the default since and per_source values */
$environment->define_default_constants($config);
/* setup ini settings */
if (!$config->get('disable_ini_settings')) {
require APP_PATH.'lib/ini_set.php';
}
/* log some debug stats about the page */
if (DEBUG_MODE) {
Hm_Debug::load_page_stats();
}
/* process the request */
new Hm_Dispatch($config);
if (empty($config)) {
$config = new Hm_Site_Config_File();
}