-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoload.php
More file actions
38 lines (32 loc) · 868 Bytes
/
autoload.php
File metadata and controls
38 lines (32 loc) · 868 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
<?php
// loading composer modules
require(__DIR__.'/vendor/autoload.php');
// loading local modules
// func to recursively lookup for a pattern in a directory
function glob_recursive($pattern, $flags = 0) {
$files = glob($pattern, $flags);
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
$files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));
}
return $files;
}
$index_directories = [
"/controllers/",
"/data/",
];
foreach($index_directories as $dirname) {
foreach(glob_recursive(__DIR__.$dirname.'**.php') as $filename) {
require_once($filename);
}
}
// load debugbar
//use Data\Config;
//use DebugBar\StandardDebugBar;
//
//if (Config::$env === "dev") {
// // load debugbar
//
// Config::$debugbar = new StandardDebugBar();
// Config::$debugbar["messages"]->addMessage("hello world!");
//}
?>