-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
autoload.php
75 lines (50 loc) · 1.42 KB
/
autoload.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
<?php
/**
* This file should be loaded in application entry point ("../index.php" for example).
*
* It takes care of:
* - Loading VELOX classes "../classes/" and "../app/".
* - Loading VELOX functions "../functions/".
* - Loading Composer "../vendor/" if available.
* - Loading additional paths defined in "./additional.php".
*/
/**
* App start time.
*
* @var float
*/
define('START_TIME', microtime(true));
/**
* App base path.
*
* @var string
*/
define('BASE_PATH', dirname(__DIR__));
// global variables holder for various VELOX global state variables
$_VELOX = [];
// load VELOX classes from "../classes/", "../app/" and alias them
require(BASE_PATH . '/bootstrap/loader.php');
// load composer autoload if composer is used in this project
$composer = BASE_PATH . '/vendor/autoload.php';
if (file_exists($composer)) {
require($composer);
}
unset($composer);
// functions are required separately to allow for a variable number of files to be required
$functions = BASE_PATH . '/functions';
if (file_exists($functions)) {
require_recursive($functions);
}
unset($functions);
// load additional files defined in "./additional.php"
$includes = include(BASE_PATH . '/bootstrap/additional.php');
foreach ($includes as $include) {
if (is_file($include)) {
require($include);
}
if (is_dir($include)) {
require_recursive($include);
}
unset($include);
}
unset($includes);