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);