aboutsummaryrefslogtreecommitdiff
path: root/autoload.php
diff options
context:
space:
mode:
Diffstat (limited to 'autoload.php')
-rw-r--r--autoload.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/autoload.php b/autoload.php
new file mode 100644
index 0000000..b9d471b
--- /dev/null
+++ b/autoload.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+// Borrowed and modified from PSR-4 Closure Example
+spl_autoload_register(
+ function ($class) {
+ $prefix = 'AugustOffensive\\';
+ $relative_class = substr($class, strlen($prefix));
+
+ // find file in /private/ in respective namespace path
+ $file = __DIR__ . '/private/' . str_replace('\\', '/', $relative_class) . '.php';
+
+ // if the file exists, require it
+ if (file_exists($file)) {
+ require $file;
+ }
+ }
+);