We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c2f1c7 commit 9efb34dCopy full SHA for 9efb34d
1 file changed
src/Middleware.php
@@ -17,8 +17,8 @@
17
use support\Log;
18
use support\Redis;
19
use think\db\connector\Mysql;
20
-use think\DbManager;
21
-use think\facade\Db as ThinkDb;
+use Webman\ThinkOrm\DbManager;
+use support\think\Db as ThinkDb;
22
use think\Container as ThinkContainer;
23
24
class Middleware implements MiddlewareInterface
@@ -178,6 +178,9 @@ protected function initDbListen()
178
}
179
$dispatcher = $capsule->getEventDispatcher();
180
if (!$dispatcher) {
181
+ if (!class_exists(Dispatcher::class)) {
182
+ return;
183
+ }
184
$dispatcher = new Dispatcher(new Container);
185
186
$dispatcher->listen(QueryExecuted::class, function (QueryExecuted $query) {
0 commit comments