Переглянути джерело

调整MongoDB连接 验证策略.

王刚 3 роки тому
батько
коміт
4fbbd5ad59
2 змінених файлів з 2 додано та 42 видалено
  1. 1 1
      Gameserver/Amfphp/config.php
  2. 1 41
      Gameserver/Amfphp/test.php

+ 1 - 1
Gameserver/Amfphp/config.php

@@ -97,7 +97,7 @@ abstract class config {
         if (GAME_ONLINE) {
             $this->_InitOuterMongoDB();
         } else {
-            $this->mongodb = "mongodb://gwang:wanggang1985@192.168.10.16:27017/?authSource=admin";
+            $this->mongodb = "mongodb://ylsj2019eXNsag==:wanggang1985@192.168.10.16:27017/?authSource=ylsj2019";
         }
     }
 

+ 1 - 41
Gameserver/Amfphp/test.php

@@ -12,44 +12,4 @@ echoLine("tsDay:" . totalDays());
 //
 //set_time_limit(15);                                                           # 设置执行超时时间
 //
-//$cfg = config::Inst();
-//$mu = new MongoUtil();
-//$manager = $mu->conn($cfg->mongodb);
-//if ($manager === false) {
-//    CLog::err("MongoDB连接异常!");
-//}
-
-CLog::err("这是一条错误日志!");
-SelfChecker::CheckAll();
-
-// select
-$collection = 'test.ylsj2019taptap';
-$filter = ['key' => ['$regex' => '.*-g$']];
-$opt = MongoUtil::QueryOptionBuilder()->limit(3)->projection(['key' => 1, 'name' => '$value.baseInfo.name'])
-        ->sort(["value.baseInfo.level" => -1]);
-
-$cursor = gMongo()->find($collection, $filter, $opt->GetOption());
-if (false === $cursor) {
-    exit("查询失败");
-}
-foreach ($cursor as $document) {
-    var_dump($document);
-}
-// insert
-$collection = "foo.bar";
-$addArr = ['name' => "王刚1", 'age' => 37];
-CLog::Assert("insert", gMongo()->insert($collection, $addArr), "插入数据");
-
-//// delete
-$collection = "foo.bar";
-$deletFilter = ['name' => "王刚1"];
-echoLine("删除" . gMongo()->delete($collection, $deletFilter) . "条");
-// update
-$collection = "foo.bar";
-$updateFilter = ['Name' => "王刚(wanggangzero@qq.com)1"];
-$updateArr = ['Name' => "王刚(wanggangzero@qq.com)1", 'Age' => 37, '性别' => "男", '爱好' => '女'];
-echoLine("修改" . gMongo()->update($collection, $updateFilter, $updateArr, true, false));
-
-//
-
-echoLine("---");
+