summaryrefslogtreecommitdiff
path: root/src/web/index.php
blob: 51ec65286bb7ffbc2b7a20422565f698614330fa (plain)
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
<?php /* Copyright (c) 2024 Freya Murphy */

// ========================= ENVIRONMENT ==

ini_set('html_errors', '1');

// ENVIRONMENT
//
// devlopment - do not cache any assets
//            - allways reload
//
// production - use generated timestamps
//            - for eachfile
//
define('ENVIRONMENT', 'devlopment');

// FOLDER_ROOT
//
// define folder directiroy paths based on this file
define('PHP_ROOT', dirname(__FILE__) . '/..');
define('WEB_ROOT', PHP_ROOT . '/web');
define('ASSET_ROOT', PHP_ROOT . '/assets');
define('PUBLIC_ROOT', PHP_ROOT . '/public');

// ========================== BOOTSTRAP ==

// load all third party
require(WEB_ROOT . '/third_party/parsedown.php');
require(WEB_ROOT . '/third_party/parsedown_extra.php');

// load all the config files
require(WEB_ROOT . '/config/routes.php');
require(WEB_ROOT . '/config/style.php');

// load all the helpers
require(WEB_ROOT . '/helpers/lang.php');
require(WEB_ROOT . '/helpers/aria.php');
require(WEB_ROOT . '/helpers/image.php');
require(WEB_ROOT . '/helpers/markdown.php');
require(WEB_ROOT . '/helpers/database.php');
require(WEB_ROOT . '/helpers/sanitize.php');

// load all core files
require(WEB_ROOT . '/core/core.php');
require(WEB_ROOT . '/core/component.php');
require(WEB_ROOT . '/core/controller.php');
require(WEB_ROOT . '/core/model.php');
require(WEB_ROOT . '/core/router.php');

// ============================== START ==

function __init() {
	$router = new Router();
	$router->handle_req();
};

__init();