autoload.php 581 B

1234567891011121314151617
  1. <?php
  2. if (file_exists(__DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php')) {
  3. require_once __DIR__ . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php';
  4. }
  5. spl_autoload_register(function ($class) {
  6. $name = str_replace('AlibabaCloud\\SDK\\OpenPlatform\\V20191219\\', '', $class);
  7. $file = __DIR__ . \DIRECTORY_SEPARATOR . 'src' . \DIRECTORY_SEPARATOR . str_replace('\\', \DIRECTORY_SEPARATOR, $name) . '.php';
  8. if (file_exists($file)) {
  9. require_once $file;
  10. return true;
  11. }
  12. return false;
  13. });