-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
51 lines (39 loc) · 861 Bytes
/
index.php
File metadata and controls
51 lines (39 loc) · 861 Bytes
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
<?php
use TPP\Models\TPP;
require("vendor/autoload.php");
$time = microtime(true);
prioIncludes();
includes();
new Init();
if(TPP_DEBUG) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
}
TPP::initializeConnection();
$site = new SiteController();
$site->actionIndex();
echo '<h1>loaded in ' . round(microtime(true) - $time, 7) . ' secs</h1>';
exit;
function prioIncludes() {
$priorityIncludes = [
'controllers' => [
'Controller',
],
'models' => [
'Init',
],
];
foreach($priorityIncludes as $key => $prio) {
foreach($prio as $pr) {
include_once($key . '/' . $pr . '.php');
}
}
}
function includes() {
$includes = ['controllers', 'models', 'helpers'];
foreach($includes as $inc) {
foreach(glob($inc . "/*.php") as $filename) {
include_once($filename);
}
}
}