-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdynamic.php
More file actions
44 lines (33 loc) · 887 Bytes
/
dynamic.php
File metadata and controls
44 lines (33 loc) · 887 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
<?php
namespace sequence {
/**
* Main function.
* Created and called to keep all variables out of global scope.
*
* @return root
*/
function main() {
/*
* Pre-configuration.
*/
$systemPath = __DIR__;
$homePath = "$_SERVER[HOME]/system";
// Attempt to auto-load files from $homePath first then $systemPath.
set_include_path(implode(PATH_SEPARATOR, [$homePath, $systemPath]));
// Classes are arranged by their namespace.
spl_autoload_extensions('.php');
spl_autoload_register();
// Include vendor classes.
require "$systemPath/vendor/autoload.php";
// We use UTC for everything internally.
date_default_timezone_set('UTC');
// Include additional functions.
require "$systemPath/functions.php";
/*
* Create the root.
*/
$class = 'sequence\\root';
spl_autoload($class);
return new $class($systemPath, $homePath);
}
}