From 940f948f4338af281b8c2693c671ee9ea18284ef Mon Sep 17 00:00:00 2001 From: "iyuu.cn" <367013672@qq.com> Date: Sat, 15 Feb 2020 22:11:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Client/AbstractClient.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Client/AbstractClient.php b/app/Client/AbstractClient.php index 7a0e406..5f8d761 100644 --- a/app/Client/AbstractClient.php +++ b/app/Client/AbstractClient.php @@ -19,8 +19,11 @@ abstract class AbstractClient $host = $config['host']; $username = $config['username']; $password = $config['password']; - - $className = "IYUU\Client\\" . $type . "\\" . $type; + $file = __DIR__ . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $type .'.php'; + if (!is_file($file)) { + die($file.' 文件不存在'); + } + $className = "\IYUU\Client\\" . $type . "\\" . $type; if (class_exists($className)) { echo $type." 客户端正在实例化!".PHP_EOL; return new $className($host, $username, $password);