Log_Autoload.php 540 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * Copyright (C) Alibaba Cloud Computing
  4. * All rights reserved
  5. */
  6. $version = '0.6.0';
  7. function Aliyun_Log_PHP_Client_Autoload($className) {
  8. $classPath = explode('_', $className);
  9. if ($classPath[0] == 'Aliyun') {
  10. if(count($classPath)>4)
  11. $classPath = array_slice($classPath, 0, 4);
  12. $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php';
  13. if (file_exists($filePath))
  14. require_once($filePath);
  15. }
  16. }
  17. spl_autoload_register('Aliyun_Log_PHP_Client_Autoload');