summaryrefslogtreecommitdiffstats
path: root/autoload.php
diff options
context:
space:
mode:
Diffstat (limited to 'autoload.php')
-rw-r--r--autoload.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/autoload.php b/autoload.php
new file mode 100644
index 0000000..d9f9e3c
--- /dev/null
+++ b/autoload.php
@@ -0,0 +1,21 @@
+<?php
+
+spl_autoload_register(function ($class) {
+
+ $prefix = 'League\Csv\\';
+ if (0 !== strpos($class, $prefix)) {
+ return;
+ }
+
+ $file = __DIR__
+ .DIRECTORY_SEPARATOR
+ .'src'
+ .DIRECTORY_SEPARATOR
+ .str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen($prefix)))
+ .'.php';
+ if (!is_readable($file)) {
+ return;
+ }
+
+ require $file;
+});