Commit e1b3d04
committed
Support Mongodb Cluster and add uri options.
[EN]
Mongodb Cluster support and uri options addition.
1. Driver Class
* buildConnectionURI method is changed(servers, options setting examination logic is added, The logic creating host string that depends on server variables is added)
2. Config Class
* servers property is changed(string > array)
* options property is added
* options property get/set method is added
example
$config = new Phpfastcache\Drivers\Mongodb\Config();
$config->setDatabaseName(‘DatabaseName’);
$config->setUsername(‘UserName’);
$config->setPassword(‘Password’);
$config->setOptions([‘option’=>‘val’]]);
$config->setServers([
[
‘host’ => ‘127.0.0.1’,
‘port’ => 27017
],
[
‘host’ => ‘127.0.0.2’,
‘port’ => 27017
]
]);
$config->setCollectionName(‘CollectionName’);
$cacheManager = Phpfastcache\CacheManager::getInstance(‘mongodb’, $config);
[KR]
Mongodb Cluster 지원 및 uri options 추가.
1. Driver Class
* buildConnectionURI method 변경됨('servers', 'options' 설정 검사 로직 추가, servers 변수에 따라서 host string 생성하는 로직 추가)
2. Config Class
* 'servers' property type 변경(string > array)
* 'options' property 추가
* 'options' property get/set method 추가
예시
$config = new Phpfastcache\Drivers\Mongodb\Config();
$config->setDatabaseName('DatabaseName');
$config->setUsername('UserName');
$config->setPassword('Password');
$config->setOptions(['option'=>'val']]);
$config->setServers([
[
'host' => '127.0.0.1',
'port' => 27017
],
[
'host' => '127.0.0.2',
'port' => 27017
]
]);
$config->setCollectionName('CollectionName');
$cacheManager = Phpfastcache\CacheManager::getInstance('mongodb', $config);1 parent 4a94bbd commit e1b3d04
2 files changed
+42
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| |||
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
148 | | - | |
| 153 | + | |
149 | 154 | | |
150 | 155 | | |
151 | 156 | | |
| |||
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
157 | | - | |
| 162 | + | |
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
| |||
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
198 | 223 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
232 | 243 | | |
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
236 | 247 | | |
237 | 248 | | |
238 | | - | |
| 249 | + | |
239 | 250 | | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
0 commit comments