|
@@ -81,7 +81,11 @@ $task->onWorkerStart = function($task)
|
|
|
$beginDate = date('H:i',time());
|
|
|
|
|
|
$mqttCmdList = array();
|
|
|
- $websocketDB = new \Workerman\MySQL\Connection('rm-wz98r5cn33zq4ou980o.mysql.rds.aliyuncs.com', '3306', 'lampmanager', 'lampmanager@2019', 'lampmanager');
|
|
|
+
|
|
|
+ $config = json_decode(file_get_contents('./db_config.php'),true);
|
|
|
+
|
|
|
+ $websocketDB = new \Workerman\MySQL\Connection($config['hostname'], '3306', $config['username'], $config['password'], $config['dbname']);
|
|
|
+
|
|
|
|
|
|
Timer::add(1, function()
|
|
|
{
|