-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoload.php
More file actions
24 lines (23 loc) · 741 Bytes
/
Copy pathautoload.php
File metadata and controls
24 lines (23 loc) · 741 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
<?php
spl_autoload_register(function() {
$documentRoot = dirname(__FILE__);
$includePathMap = array(
$documentRoot . "/ValueObjects",
$documentRoot . "/Interfaces",
$documentRoot . "/Services/Context",
$documentRoot . "/Services",
);
foreach($includePathMap as $path) {
if(is_dir($path)) {
$files = scandir($path);
foreach($files as $file) {
if($file != "." && $file !== ".." && !is_dir($file)) {
$fullPath = $path . "/" . $file;
if(file_exists($fullPath) && !is_dir($fullPath)) {
include_once($fullPath);
}
}
}
}
}
});