mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-06 03:58:03 +08:00
[更新]修正文件引入文件
This commit is contained in:
parent
af3fbadb4a
commit
a2d43b86b0
16
include.php
16
include.php
@ -13,13 +13,15 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
spl_autoload_register(function ($classname) {
|
spl_autoload_register(function ($classname) {
|
||||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
|
$pathname = __DIR__ . DIRECTORY_SEPARATOR;
|
||||||
if (file_exists($filename)) {
|
$filename = str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
|
||||||
if (stripos($classname, 'WeChat') === 0) include $filename;
|
if (file_exists($pathname . $filename)) {
|
||||||
elseif (stripos($classname, 'WeMini') === 0) include $filename;
|
foreach (['WeChat', 'WeMini', 'AliPay', 'WePay', 'We'] as $prefix) {
|
||||||
elseif (stripos($classname, 'AliPay') === 0) include $filename;
|
if (stripos($classname, $prefix) === 0) {
|
||||||
elseif (stripos($classname, 'WePay') === 0) include $filename;
|
include $pathname . $filename;
|
||||||
elseif ($classname === 'We') include $filename;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user