You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1008 B
PHTML
33 lines
1008 B
PHTML
5 years ago
|
<?php
|
||
|
/**
|
||
|
* Copyright (C) Alibaba Cloud Computing
|
||
|
* All rights reserved
|
||
|
*/
|
||
|
|
||
|
$version = '0.6.0';
|
||
|
|
||
|
function Aliyun_Log_PHP_Client_Autoload($className) {
|
||
|
$classPath = explode('_', $className);
|
||
|
if ($classPath[0] == 'Aliyun') {
|
||
|
if(count($classPath)>5)
|
||
|
$classPath = array_slice($classPath, 0, 5);
|
||
|
if(strpos($className, 'Request') !== false){
|
||
|
$lastPath = end($classPath);
|
||
|
array_pop($classPath);
|
||
|
array_push($classPath,'Request');
|
||
|
array_push($classPath, $lastPath);
|
||
|
}
|
||
|
if(strpos($className, 'Response') !== false){
|
||
|
$lastPath = end($classPath);
|
||
|
array_pop($classPath);
|
||
|
array_push($classPath,'Response');
|
||
|
array_push($classPath, $lastPath);
|
||
|
}
|
||
|
$filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php';
|
||
|
if (file_exists($filePath))
|
||
|
require_once($filePath);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
spl_autoload_register('Aliyun_Log_PHP_Client_Autoload');
|