فهرست منبع

Fetch host by IP instead of domain name (#3799)

Wulfklaue 7 سال پیش
والد
کامیت
6163bb8c6c
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      frameworks/PHP/php/swoole-server.php

+ 3 - 3
frameworks/PHP/php/swoole-server.php

@@ -20,7 +20,7 @@ $server->on('request', function ($req, $res) {
         case "/db":
             $db = new Swoole\Coroutine\Mysql;
             $server = [
-                'host' => 'tfb-database',
+                'host' => co::gethostbyname('tfb-database'),
                 'user' => 'benchmarkdbuser',
                 'password' => 'benchmarkdbpass',
                 'database' => 'hello_world'
@@ -59,7 +59,7 @@ $server->on('request', function ($req, $res) {
         case "/fortunes":
             $db = new Swoole\Coroutine\Mysql;
             $server = [
-                'host' => 'tfb-database',
+                'host' => co::gethostbyname('tfb-database'),
                 'user' => 'benchmarkdbuser',
                 'password' => 'benchmarkdbpass',
                 'database' => 'hello_world' //;charset=utf8
@@ -87,7 +87,7 @@ $server->on('request', function ($req, $res) {
         case "/updates":
             $db = new Swoole\Coroutine\Mysql;
             $server = [
-                'host' => 'tfb-database',
+                'host' => co::gethostbyname('tfb-database'),
                 'user' => 'benchmarkdbuser',
                 'password' => 'benchmarkdbpass',
                 'database' => 'hello_world'