vali 6 年之前
父節點
當前提交
e20d497eb8
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      vendor/GatewayWorker_windows/Applications/whisper/Events.php

+ 4 - 2
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -41,8 +41,10 @@ class Events
     public static function onWorkerStart($worker)
     {
         if (empty(self::$db)) {
-            //self::$db = new \Workerman\MySQL\Connection('192.168.2.168', '3306', 'vali', '123456', 'customer_service');
-            self::$db = new \Workerman\MySQL\Connection('192.168.2.200', '3306', 'vali', '1234', 'customer_service');
+            $mds = DIRECTORY_SEPARATOR;
+            $dbcfg = realpath(dirname(__FILE__) . $mds . '..' . $mds . '..' . $mds . '..' . $mds . '..') . $mds . 'application' . $mds . 'database.php';
+            $conf = require($dbcfg);
+            self::$db = new \Workerman\MySQL\Connection($conf['hostname'], $conf['hostport'], $conf['username'], $conf['password'], $conf['database']);
         }