summaryrefslogtreecommitdiffstats
path: root/library/vendor/Psr/Loader.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--library/vendor/Psr/Loader.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/library/vendor/Psr/Loader.php b/library/vendor/Psr/Loader.php
new file mode 100644
index 0000000..45c78af
--- /dev/null
+++ b/library/vendor/Psr/Loader.php
@@ -0,0 +1,21 @@
+<?php
+/* Icinga Web 2 Elasticsearch Module (c) 2017 Icinga Development Team | GPLv2+ */
+
+spl_autoload_register(function ($class) {
+ $prefix = 'Psr\\';
+ $len = strlen($prefix);
+
+ $baseDir = __DIR__ . '/';
+
+ if (strncmp($prefix, $class, $len) !== 0) {
+ return;
+ }
+
+ $relative = substr($class, $len);
+
+ $file = $baseDir . str_replace('\\', '/', $relative) . '.php';
+
+ if (file_exists($file)) {
+ require $file;
+ }
+});