autoload.php 382 B

123456789101112131415
  1. <?php
  2. function classLoader($class) {
  3. $path = str_replace(
  4. ['\\', 'Asan' . DIRECTORY_SEPARATOR . 'PHPExcel' . DIRECTORY_SEPARATOR], [DIRECTORY_SEPARATOR, ''], $class
  5. );
  6. $file = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . $path . '.php';
  7. if (file_exists($file)) {
  8. require_once $file;
  9. }
  10. }
  11. spl_autoload_register('classLoader');