Skip to content

Commit 9efb34d

Browse files
committed
webman 2.1
1 parent 7c2f1c7 commit 9efb34d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Middleware.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
use support\Log;
1818
use support\Redis;
1919
use think\db\connector\Mysql;
20-
use think\DbManager;
21-
use think\facade\Db as ThinkDb;
20+
use Webman\ThinkOrm\DbManager;
21+
use support\think\Db as ThinkDb;
2222
use think\Container as ThinkContainer;
2323

2424
class Middleware implements MiddlewareInterface
@@ -178,6 +178,9 @@ protected function initDbListen()
178178
}
179179
$dispatcher = $capsule->getEventDispatcher();
180180
if (!$dispatcher) {
181+
if (!class_exists(Dispatcher::class)) {
182+
return;
183+
}
181184
$dispatcher = new Dispatcher(new Container);
182185
}
183186
$dispatcher->listen(QueryExecuted::class, function (QueryExecuted $query) {

0 commit comments

Comments
 (0)