فهرست منبع

变更内网MongoDB的部署位置, 切换到16服务器

王刚 3 سال پیش
والد
کامیت
300aa2f04e
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      Gameserver/Amfphp/config.php
  2. 3 3
      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://localhost:27017";
+            $this->mongodb = "mongodb://gwang:wanggang1985@192.168.10.16:27017/?authSource=admin";
         }
     }
 

+ 3 - 3
Gameserver/Amfphp/test.php

@@ -28,9 +28,9 @@ $cursor = gMongo()->find($collection, $filter, $opt->GetOption());
 if (false === $cursor) {
     exit("查询失败");
 }
-//foreach ($cursor as $document) {
-//    var_dump($document);
-//}
+foreach ($cursor as $document) {
+    var_dump($document);
+}
 // insert
 //$collection = "foo.bar";
 //$addArr = ['name' => "王刚1", 'age' => 37];