-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.php
40 lines (32 loc) · 982 Bytes
/
loader.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
<?php
/*
----------------------------------
------ Created: 122123 ------
------ Austin Best ------
----------------------------------
*/
// This will NOT report uninitialized variables
error_reporting(E_ERROR | E_PARSE);
if (!defined('ABSOLUTE_PATH')) {
define('ABSOLUTE_PATH', './');
}
if (!file_exists(ABSOLUTE_PATH . '.secrets')) {
exit('.secrets file is missing');
}
//-- BRING IN THE SECRETS CONFIG
$secrets = json_decode(file_get_contents(ABSOLUTE_PATH . '.secrets'), true);
//-- DIRECTORIES TO LOAD FILES FROM, ORDER IS IMPORTANT
$autoloads = ['includes', 'functions', 'classes'];
foreach ($autoloads as $autoload) {
$dir = ABSOLUTE_PATH . $autoload;
if (is_dir($dir)) {
$handle = opendir($dir);
while ($file = readdir($handle)) {
if ($file[0] != '.' && !is_dir($dir . '/' . $file)) {
require $dir . '/' . $file;
}
}
closedir($handle);
}
}
$naApi = new NetActuate;