@@ -110,10 +110,11 @@ private function globalConfig()
110
110
}
111
111
}
112
112
113
- $ this ->config ['database_host ' ] = $ this ->connection ->getHost ();
114
- $ this ->config ['database_name ' ] = $ this ->connection ->getDatabase ();
115
- $ this ->config ['database_user_name ' ] = $ this ->connection ->getUsername ();
116
- $ this ->config ['database_password ' ] = $ this ->connection ->getPassword ();
113
+ $ this ->config ['database_host ' ] = $ this ->connection ->getParams ()['host ' ];
114
+ $ this ->config ['database_port ' ] = $ this ->connection ->getParams ()['port ' ];
115
+ $ this ->config ['database_name ' ] = $ this ->connection ->getParams ()['dbname ' ];
116
+ $ this ->config ['database_user_name ' ] = $ this ->connection ->getParams ()['user ' ];
117
+ $ this ->config ['database_password ' ] = $ this ->connection ->getParams ()['password ' ];
117
118
118
119
if (empty ($ global ['title ' ])) {
119
120
$ this ->io ->error ('文档标题不能为空 ' );
@@ -977,9 +978,10 @@ function generateDataFile()
977
978
//配置数据库
978
979
$ database = $ config ['database_name ' ];
979
980
$ dbserver = $ config ['database_host ' ];
981
+ $ dpord = $ config ['database_port ' ];
980
982
$ dbusername = $ config ['database_user_name ' ];
981
983
$ dbpassword = $ config ['database_password ' ];
982
- $ mysql_conn = mysqli_connect ("$ dbserver " , "$ dbusername " , "$ dbpassword " );
984
+ $ mysql_conn = mysqli_connect ("$ dbserver " , "$ dbusername " , "$ dbpassword " , null , $ dpord );
983
985
if (!$ mysql_conn ) {
984
986
$ data_html .= '<div class="not-found">数据库连接失败</div> ' ;
985
987
} else {
0 commit comments