Skip to content

Commit 0420d03

Browse files
authored
Merge pull request #1 from ichynul/patch-1
支持`think-orm`缓存
2 parents 25bd103 + c67a25a commit 0420d03

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ThinkCache.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Webman\Bootstrap;
66
use Workerman\Timer;
77
use think\facade\Cache;
8+
use think\Container;
9+
use think\DbManager;
810

911
class ThinkCache implements Bootstrap
1012
{
@@ -20,5 +22,10 @@ public static function start($worker)
2022
Cache::get('ping');
2123
});
2224
}
25+
26+
if (class_exists(DbManager::class)) {
27+
$manager_instance = Container::getInstance()->make(DbManager::class);
28+
$manager_instance->setCache(Cache::store());
29+
}
2330
}
24-
}
31+
}

0 commit comments

Comments
 (0)