autoload.php 482 B

123456789101112131415161718192021222324
  1. <?php
  2. spl_autoload_register(function($class) {
  3. $classPath = str_replace('Lychee\\', '', $class);
  4. $classPath = str_replace('\\', DIRECTORY_SEPARATOR, $classPath);
  5. $file = LYCHEE . 'php/' . $classPath . '.php';
  6. if (file_exists($file)===true) require $file;
  7. });
  8. spl_autoload_register(function($class) {
  9. $classPath = str_replace('\\', DIRECTORY_SEPARATOR, $class);
  10. $file = LYCHEE . 'plugins/' . $classPath . '.php';
  11. if (file_exists($file)===true) require $file;
  12. });
  13. ?>