From d355bf12c894dbfe6c97d975c1a7f2ad65724934 Mon Sep 17 00:00:00 2001 From: zyimm Date: Sun, 23 Oct 2022 15:22:06 +0800 Subject: [PATCH] update readme --- README.md | 10 ++++++---- src/Mongodb.php | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c2ea5a2..2eb7c16 100644 --- a/README.md +++ b/README.md @@ -8,19 +8,21 @@ 2. 增加单元测试,优化依赖。 3. 规范代码编写,简洁了源代码中一些不规范,重复高的代码。 -# hyperf mongodb pool +# 使用 +## 设置仓库源 ``` -## step 1 + { "repositories": [{ "type": "composer", "url": "http://composer.zyimm.com" }] } +``` +## 安装 -## step 2 - +``` composer require zyimm/hyperf-mongodb ``` diff --git a/src/Mongodb.php b/src/Mongodb.php index 8f5ca17..1b24822 100644 --- a/src/Mongodb.php +++ b/src/Mongodb.php @@ -27,6 +27,11 @@ class Mongodb */ protected $poolName = 'default'; + /** + * Mongodb + * + * @param PoolFactory $factory + */ public function __construct(PoolFactory $factory) { $this->factory = $factory; @@ -79,6 +84,8 @@ class Mongodb } /** + * getContextKey + * * The key to identify the connection object in coroutine context. */ private function getContextKey(): string