autoload.php 412 B

123456789101112131415161718192021
  1. <?php
  2. spl_autoload_register(function ($class) {
  3. $prefix = 'League\Csv\\';
  4. if (0 !== strpos($class, $prefix)) {
  5. return;
  6. }
  7. $file = __DIR__
  8. .DIRECTORY_SEPARATOR
  9. .'src'
  10. .DIRECTORY_SEPARATOR
  11. .str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen($prefix)))
  12. .'.php';
  13. if (!is_readable($file)) {
  14. return;
  15. }
  16. require $file;
  17. });