mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-05 19:41:44 +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) {
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
|
||||
if (file_exists($filename)) {
|
||||
if (stripos($classname, 'WeChat') === 0) include $filename;
|
||||
elseif (stripos($classname, 'WeMini') === 0) include $filename;
|
||||
elseif (stripos($classname, 'AliPay') === 0) include $filename;
|
||||
elseif (stripos($classname, 'WePay') === 0) include $filename;
|
||||
elseif ($classname === 'We') include $filename;
|
||||
$pathname = __DIR__ . DIRECTORY_SEPARATOR;
|
||||
$filename = str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
|
||||
if (file_exists($pathname . $filename)) {
|
||||
foreach (['WeChat', 'WeMini', 'AliPay', 'WePay', 'We'] as $prefix) {
|
||||
if (stripos($classname, $prefix) === 0) {
|
||||
include $pathname . $filename;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user