autoload.php 299 B

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